Page 1 of 1

Re: Shell Script is not executing with php script

Posted: Mon Jun 04, 2012 9:57 pm
by Emy
I think it is a disabled function on the server side, if you have access to the server php.ini, then you could delete it, otherwise contact your server admin, reason it is disabled, is for security reason:

Code: Select all

disable_functions = symlink,shell_exec,exec,proc_close,proc_open,popen,system,dl,passthru,escapeshellarg,escapeshellcmd

Re: Shell Script is not executing with php script

Posted: Tue Jun 05, 2012 11:04 am
by ejsexton82
You also have to be careful when specifying relative paths using dot notation. I had a lot of trouble myself getting shell scripts to execute in both the PHP client and on the website.

I always specify a path relative to the PHP file now:

Code: Select all

$output = shell_exec(dirname(__FILE__) . '/script.sh');