View Full Version : exec() problem
07-24-2007, 04:49 PM
Using exec to run an ImageMagick script after using move_uploaded_file to a temp folder in my directory:
exec(convert /home/twsports/public_html/images/news/tmp/main_football.jpg -resize 150x150 /home/twsports/public_html/images/news/main_football.jpg)
I have chmod the /news/ and /news/tmp/ directories to 777 to allow read/write/execute
The file is being moved to tmp but the exec function is not working.
When I ssh the command it works.
07-25-2007, 02:22 AM
try the full path to convert ('which convert' on the command line)
exec('/usr/bin/convert /home/twsports/public_html/images/news/tmp/main_football.jpg -resize 150x150 /home/twsports/public_html/images/news/main_football.jpg');
07-25-2007, 11:20 AM
Firepages: Tried that to no effect.
Anyone else got a suggestion? I would gladly try anything at this stage. It has been working previously but I must have configured something on the server to conflict with the command.
Try and check the following
1- Your server has access to the directory where you are running the exec command. Sometimes Apache is restricted to a specific folder and therefore, it won't execute if Apache doesn't have access to that folder.
2- Check that your server support the exec function. Some hosts might disable this function altogether for security reasons.
3- Please check what output is generated when you run the exec command
exec( "comamnd", $output );
If your server is running on a windows machine, you might have to alter the privileges under which Apache runs on, in order to grant it access privileges to System commands.
Otherwise, check the following url which provides an alternative approach to the exec command
07-25-2007, 03:37 PM
Problem has been sorted with some server admin help and a reboot.
I have been using the convert lib of Imagemagick without problem since it was installed on my server. Recently it just stopped working from the script although the ssh manual command worked fine.
I am keeping an eye on it and using the full path name of the lib file just in case
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.