The difference between exec and popen

I want to run an external PHP file on my server. I found out that I can use either exec, or popen.

I read what is popenused for Windows, and execfor Linux.

On the other hand, I saw examples where popenit can also be used for Linux. I'm still a beginner. Is it possible? What do you recommend for Linux if working execand popen?

I apologize for the benefits, since I'm still confused.

+4
source share
3 answers

, exec() shell_exec(). popen() , , , fopen() . fopen() , . (fread(), fwrite()) .

popen().

exec() shell_exec() , linux.

+4

PHP . Linux, Windows ( , PHP). "" - , PHP

+1

popen PHP - Apache. exec, shell_exec pclose (popen (...)), , , popen. script .

- CentOS7, PHP 5.4.16 Apache 2.4, Windows.

+1

All Articles