I need to execute the imagemagick /usr/X11R6/bin/convert program within a php script. The command line: /Absolute-path-to/convert -geometry 150x150 /Absolute-path-to/PHP_image.gif /path-to/PHP_scaledimage.gif works fine from the shell. Within a php script the following line does nothing: system ("/Absolute-path-to/convert -geometry 150x150 /Absolute-path-to/PHP_image.gif /path-to/PHP_scaledimage.gif") I think it's related to some security parameters to not execute some commands from the Web. Directory/files set to 777 and scripts set to 755 SuSE 7.0 PPc Edition PHP 3.03pl1 thanks a lot for you help.
Hi, On Sat, 6 Jan 2001 abarguia@mail.belgavillage.be wrote:
Within a php script the following line does nothing:
system ("/Absolute-path-to/convert -geometry 150x150 /Absolute-path-to/PHP_image.gif /path-to/PHP_scaledimage.gif")
Have you disabled safe_mode in your PHP Ini-file? If not you'll only be
able to Exec, System, PassThru and Popen Executables residing in
PHP_SAFE_MODE_EXEC_DIR which is a #define from php.h (hence set at compile
time).
You can either say "safe_mode = 0" (which will defeat some of the security
measures PHP provides) or simply edit/use PHP_SAFE_MODE_EXEC_DIR. You
better do the latter.
Visit the PHP Documentation at www.php.net for more information,
especially http://www.php.net/manual/phpfi2.html#safemode.
Regards, -Sebastian
--
Sebastian Fallert |"The maximum length of a function
Get PGP Key available at public | is inversely proportional to the
Keyservers. | complexity and indentation level
Get PGP Fingerprint/Key or Geekcode | of that funtion."
fingering sfaller@linux01.gwdg.de | (Linux Kernel Documentation)
Hi,
On Sat, 6 Jan 2001 abarguia@mail.belgavillage.be wrote:
Within a php script the following line does nothing:
system ("/Absolute-path-to/convert -geometry 150x150 /Absolute-path-to/PHP_image.gif /path-to/PHP_scaledimage.gif")
Have you disabled safe_mode in your PHP Ini-file? If not you'll only be able to Exec, System, PassThru and Popen Executables residing in PHP_SAFE_MODE_EXEC_DIR which is a #define from php.h (hence set at compile time).
You can either say "safe_mode = 0" (which will defeat some of the security measures PHP provides) or simply edit/use PHP_SAFE_MODE_EXEC_DIR. You better do the latter.
Thanks Sebastien for your answer. I had already set safe_mode to off. I am aware about the security issues. I just wanted to test my script. the command system ("ls -l") works fine, so I am wondering if the problem doesn't reflect a bug in PHP4.03pl1 or in a suse module regards cherif abarguia
Hi,
On Sat, 6 Jan 2001 abarguia@mail.belgavillage.be wrote:
Within a php script the following line does nothing:
system ("/Absolute-path-to/convert -geometry 150x150 /Absolute-path-to/PHP_image.gif /path-to/PHP_scaledimage.gif")
Have you disabled safe_mode in your PHP Ini-file? If not you'll only be able to Exec, System, PassThru and Popen Executables residing in PHP_SAFE_MODE_EXEC_DIR which is a #define from php.h (hence set at compile time).
Sebastien, I want to thank you for your help. I followed this suggestion and everything works fine right now. abarguia
participants (2)
-
abarguia@mail.belgavillage.be
-
Sebastian Fallert