Ermitgilsukaru
Registered
I don't really know if this is the right place to post this, but here goes.
I am trying to build a site with PHP. It contains picture galleries and should automate the creation of thumbnails. I was going to use Image Magick to make a scaled copy of every incoming picture. The problem is I don't know how to do it through PHP.
I tried to use exec() like this:
But nothing happened. No error messages of any kind or anything like that, the image simply had not been changed. I then tried to use exec() with a return variable and printing it out, like this:
When I ran the script with these lines the image stayed unchanged as before but printed out "127".
My questions are these:
Why does the script return "127"?
Is there any other way to execute shell commands in PHP?
How else could I make thumbnails in PHP?
Oh, and also where is the php.ini file located in Mac OS X?
I am trying to build a site with PHP. It contains picture galleries and should automate the creation of thumbnails. I was going to use Image Magick to make a scaled copy of every incoming picture. The problem is I don't know how to do it through PHP.
I tried to use exec() like this:
PHP:
exec("mogrify -geometry 120x120 /foo/bar.jpg"); //Where mogrify is a Image Magick command and /foo/bar.jpg was the path to the image
But nothing happened. No error messages of any kind or anything like that, the image simply had not been changed. I then tried to use exec() with a return variable and printing it out, like this:
PHP:
exec("mogrify -geometry 120x120 /foo/bar.jpg" $return_variable);
echo $return_variable;
When I ran the script with these lines the image stayed unchanged as before but printed out "127".
My questions are these:
Why does the script return "127"?
Is there any other way to execute shell commands in PHP?
How else could I make thumbnails in PHP?
Oh, and also where is the php.ini file located in Mac OS X?