Steve Turnbull
Jun 22 2005, 10:36 AM
Hi
Could someone tell me how to execute a linux shell command with PHP? I am
using PHP as a bash script and want to issue the command;
convert -sample 25%x25% $img thumb.$img
It is just a simple script to convert jpg's into thumbnails and I am more
at home with PHP than bash...
Thanks
Steve
Veikko Mkinen
Jun 22 2005, 12:45 PM
Steve Turnbull wrote:
QUOTE |
Hi
Could someone tell me how to execute a linux shell command with PHP?
|
http://www.php.net/manual/en/ref.exec.phpeg. exec("convert -sample 25%x25% $img thumb.$img");
But these functions are often disabled on public servers and you should
also be aware that the command might be executed by the user running the
web server (running PHP as CGI or with suexec wrapper is the cure for this).
-veikko
--
veikko
mail@ .com
makinen
Steve Turnbull
Jun 23 2005, 11:46 AM
On Wed, 22 Jun 2005 16:45:21 +0300, Veikko Mkinen wrote:
QUOTE |
Steve Turnbull wrote: Hi
Could someone tell me how to execute a linux shell command with PHP?
http://www.php.net/manual/en/ref.exec.php eg. exec("convert -sample 25%x25% $img thumb.$img");
But these functions are often disabled on public servers and you should also be aware that the command might be executed by the user running the web server (running PHP as CGI or with suexec wrapper is the cure for this).
-veikko Thanks for the reply |
I have CGI installed in my PHP, how would I go about executing a command
from within there? Could you elaborate please?
Thanks
Steve