Re: exec / shell_exec issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



WAIT - DISREGARD THAT LAST POST - I forgot to // some other debug lines - the output is inconsistent with what I was testing (Robert's code) - I'll do better.....


leonski wrote:
Robert Cummings wrote:

On Fri, 2005-07-29 at 22:17, leonski wrote:

Jason Wong wrote:

On Saturday 30 July 2005 08:49, leonski wrote:



sh: line 1: /usr/local/bin/mogrify /tmp/phpS1KCen -resize 320x240! :
No such file or directory sh: line 1: /usr/local/bin/mogrify
/tmp/phpS1KCen -resize 95x72! : No such file or directory

beats me how it gets inside the if, if it doesn't exist!



I think the error message is trying to tell you that "/usr/local/bin/mogrify" does not exist.


:-( yeah it does and it works under the terminal (nicely I might add, thanks ImageMagick).
leonski.



Because you've used escapeshellargs() (or whatever it is) it's probably
treating the entire parameter to exec() (excluding the string
concatenation for output redirection) as the command to execute. I know
you said  you tried it otherwise but try the following:

if( file_exists( $imagefile ) )
{
    $arg = escapeshellarg( $imagefile );
    exec( "/usr/local/bin/mogrify $arg -resize 95x72 ");
}

Cheers,
Rob.


did:

if( file_exists( $imagefile ) )
            {
                $arg = escapeshellarg( $imagefile );
                echo $str= "/usr/local/bin/mogrify $arg -resize 95x72 ";
                exec($str);
            }

added a line so I could see the string....

got:

/usr/local/bin/mogrify '/tmp/phpPdCiGS' -resize 95x72
Warning: fopen('/tmp/phpPdCiGS') [function.fopen]: failed to open stream: No such file or directory in /Library/WebServer/Documents/build2/admin/classes/class_upload.php on line 254

so again - how does it get past the file_exists if it doesn't?!!!

keep it coming Robert....;-)

leonski.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux