You are here: Re: [PHP] exec / shell_exec issues « PHP « IT news, forums, messages
Re: [PHP] exec / shell_exec issues

Posted by Robert Cummings on 07/30/05 05:23

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.
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация