Reputation: 1
I am trying to call a PHP script from another PHP script using the shell_exec
command. when I enter the same command in the shell using the same user, everything works as expected. However, when I call it in PHP I got the following output:
X-Powered-By: PHP/5.3.23
Content-type: text/html
My PHP call is:
shell_exec('php -f /home/site/public_html/script.php > /home/site/log.txt &');
I check server configuration. Safe Mode is off. shell_exec('whoami')
is working without any problem.
Upvotes: 0
Views: 1348
Reputation: 3135
try
shell_exec('/usr/bin/php -f /home/site/public_html/script.php > /home/site/log.txt &');
or type
whereis php
and use the path given.
Upvotes: 1