bash - Cant run shell script in PHP -


when trying run shell script exec , shell_exe nothing happens! when run command ls or whoami work's.

what be?

do echo output?

echo exec('ls'); 

do have safe_mode enabled?

phpinfo(); 

when yes: (from manual)

note: when safe mode enabled, can execute files within safe_mode_exec_dir. practical reasons, not allowed have .. components in path executable.

try call exec

exec('...pathtoyourbashscript...', $out, $return); 

then

echo $return; 

if shows 127 it´s path wrong.

also check permissions. user 'nobody' apache user, needs rights access , execute script.

you can change permissions running

chmod 755 pathtouyourscript

this means 'i don't mind if other people read or run file, should able modify it'.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -