No, it not on...

safe_mode       Off     Off
safe_mode_exec_dir      no value        no value
safe_mode_gid   Off     Off
safe_mode_include_dir   no value        no value

.M



Adam Zey wrote:
Michael Jonsson wrote:
Hi,

I can run any external program like ls, cp, uptime...
But if a try to run my shell script a get error.

         $passwdexe = "sudo /usr/bin/webpasswd";
         $user=$_POST[name];
         $passwd="$passwdexe $user 123456";
         echo $passwd;
         $result = system($passwd);

Resultat from the web, "sudo /usr/sbin/webpasswd billy 12345678"
and from the error_log, "couldn't read file "./usr/sbin/webpasswd.": no such file or directory".

.Mike


Notice that "." is being appended before the path, which turns it into a relative path. It looks like safe mode might be on.

Create a new PHP script with nothing but the command "phpinfo();" in it, and view it in a browser. To see if safe mode is on, look for the setting "safe_mode". The line below it is "safe_mode_exec_dir". If safe mode is on, you'll need to put your program ("webpasswd") into that directory to execute it.

Regards, Adam Zey.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to