Re: [PHP] Error with system() when running convert
There's a cool utility at: http://freespace.sourceforge.net/errno/index.html Of course, errno 127 is 'unknown error', so it wouldn't have been a huge help. On Tue, 21 Dec 2004 11:00:05 -0800 (PST), Richard Lynch [EMAIL PROTECTED] wrote: with anything else. Has anyone run across error 127 from system, or have any idea what's going on? For future reference, find a convenient way to look up 127 error code number in your OS. man errno is sort of okay in most Un*xes, except then you have to count 127 lines down to get the right number. Some day, when I find the time, I'm gonna write that PHP source code function to return an error message from a number, just like C's errlist, so 'exec' and friends can actually be used by mere mortals... I've only been saying this since 1997, so don't worry if you feel like writing it yourself -- You'll beat me to it and gain all the oosphere glory for yourself. :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error with system() when running convert
I'm using some system calls to do some image processing, mostly just resize, compress, and a few other simple tasks on some jpgs. I'm using convert, djpeg, cjpeg, mogrify, etc to accomplish this. The issue I'm running into now is that I have a command that runs fine from the command line, but not through system. It returns an error code of 127, which wasn't helpful to me. The actual command is to convert, convert $img1 -negate $img2. If I print the command, then copy and paste into a terminal, it works. It doesn't work through php, though, and there is no output from convert, it just fails silently. I have two thoughts on the matter: the first was that it was permissions based, but no matter how loose I make the permissions, it still won't work. Besides, other commands have no such issues. The second thought is that php is running out of memory, as perhaps the convert command is very intensive? It doesn't seem right to me, but it was mentioned in the comments on the php website, and I can't come up with anything else. Has anyone run across error 127 from system, or have any idea what's going on? Thanks, Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Error with system() when running convert
Well, answering my own question, it turns out that convert is in /usr/X11R6/bin, which is not in php's path. Creating an alias in /usr/bin solved the issue. On Tue, 21 Dec 2004 00:59:40 -0500, Jonathan Schwarz [EMAIL PROTECTED] wrote: I'm using some system calls to do some image processing, mostly just resize, compress, and a few other simple tasks on some jpgs. I'm using convert, djpeg, cjpeg, mogrify, etc to accomplish this. The issue I'm running into now is that I have a command that runs fine from the command line, but not through system. It returns an error code of 127, which wasn't helpful to me. The actual command is to convert, convert $img1 -negate $img2. If I print the command, then copy and paste into a terminal, it works. It doesn't work through php, though, and there is no output from convert, it just fails silently. I have two thoughts on the matter: the first was that it was permissions based, but no matter how loose I make the permissions, it still won't work. Besides, other commands have no such issues. The second thought is that php is running out of memory, as perhaps the convert command is very intensive? It doesn't seem right to me, but it was mentioned in the comments on the php website, and I can't come up with anything else. Has anyone run across error 127 from system, or have any idea what's going on? Thanks, Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php