The code for executing execPHP in Linux is 5.4PHP: & lt ;? Phpexec (whoami, & nbsp; $ r); var_dump ($ r); the root user uses php & nbsp; test on the server terminal. the php output result is as follows, which is correct [[email & #160; protected] & nbsp; htdocs] # & nbsp; php & nbsp; test. PHP executes exec in Linux
PHP 5.4
The PHP code is as follows:
Exec ('whoam', $ r );
Var_dump ($ r );
Root users use php test. php on the server terminal
The output result is as follows, which is correct.
[[Email protected] htdocs] # php test. php
Array (1 ){
[0] =>
String (4) "root"
}
But enter the http://192.168.x.x/test.php in the browser
The output is empty.
I feel that it is a permission issue on the linux server, but I don't know which permission issue.
The user name for running httpd is apache.
------ Solution --------------------
Whoami display login name
The viewer accesses the website anonymously (that is, without a name), so it is correct to display it as null.
------ Solution --------------------
Output the error and you will know if the permission is incorrect.