thierry91
asked on
how to solve "backquotes" problem for shell_exec():
hello
I use script php shell for make some action and in this php file I use function shell_exec():
but this create error :
Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in /root/mail_check.php on line 68
but see this part of my conf php :
safe_mode = Off
safe_mode_gid = Off
; safe_mode_include_dir = /data/www/generated
; safe_mode_exec_dir = /data/www/bin
; safe_mode_allowed_env_vars = PHP_
; safe_mode_protected_env_va rs = LD_LIBRARY_PATH
safe mode is Off
and line woth probleme in php script is :
$commande="/root/qmHandle -D"; //line 67
$result=shell_exec($comman de); //line 68
echo $result; //line 69
have you solution ?
I use script php shell for make some action and in this php file I use function shell_exec():
but this create error :
Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in /root/mail_check.php on line 68
but see this part of my conf php :
safe_mode = Off
safe_mode_gid = Off
; safe_mode_include_dir = /data/www/generated
; safe_mode_exec_dir = /data/www/bin
; safe_mode_allowed_env_vars
; safe_mode_protected_env_va
safe mode is Off
and line woth probleme in php script is :
$commande="/root/qmHandle -D"; //line 67
$result=shell_exec($comman
echo $result; //line 69
have you solution ?
Is the safe_mode really off? Check it in phpinfo(). Look at Local value column. Maybe safe_mode is off by default n your configuration, but it's turned on in vhost definition or some .htaccess file?
ASKER
for exec my script I use special php.ini
and my script php is start with this commande :
php -c /root/phpini/ /root/mail_check.php
and if you see in my question I give part of php.ini I use :
safe_mode = Off
safe_mode_gid = Off
; safe_mode_include_dir = /data/www/generated
; safe_mode_exec_dir = /data/www/bin
; safe_mode_allowed_env_vars = PHP_
; safe_mode_protected_env_va rs = LD_LIBRARY_PATH
but for you can see I have attach php.ini used.
thx
php.ini.txt
and my script php is start with this commande :
php -c /root/phpini/ /root/mail_check.php
and if you see in my question I give part of php.ini I use :
safe_mode = Off
safe_mode_gid = Off
; safe_mode_include_dir = /data/www/generated
; safe_mode_exec_dir = /data/www/bin
; safe_mode_allowed_env_vars
; safe_mode_protected_env_va
but for you can see I have attach php.ini used.
thx
php.ini.txt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thx, the probleme is simple :
php -c /root/phpini/ /root/mail_check.php // -> BAD
php -c /root/phpini/.php.ini /root/mail_check.php // -> GOOD
thx
php -c /root/phpini/ /root/mail_check.php // -> BAD
php -c /root/phpini/.php.ini /root/mail_check.php // -> GOOD
thx