Hi, a few weeks ago i posted my problem and finally i got the solution. Or that is what i thought. The problem is still there.
When i use this via SSH
"/kunden/homepages/39/d296597816/htdocs/imagick6.7/bin/convert input.jpg -scale 600x300 -background white -gravity center -extent 600x300 output.jpg"
it works 100% perfect.
When i use this via PHP
exec("/kunden/homepages/39/d296597816/htdocs/imagick6.7/bin/convert input.jpg -scale 600x300 -background white -gravity center -extent 600x300 output.jpg");
(the same as above)
This don't work.
I tried everything and still have no idea what's the problem. Any idea?
How can capture a "text error" on the PHP exec?
Things like
exec("$pathTo/convert input.jpg -scale $width output.jpg");
works perfect on both sides.
Maybe there is another way to do the command posted above?
I tried with:
exec("/kunden/homepages/39/d296597816/htdocs/imagick6.7/bin/convert imagenPruebas.jpg -fill white -scale 600x600^ output.jpg");
But it doesnt fill the white space.
Sorry for my English.
Finally i manage to catch the error. I get the following error:
libgomp: Thread creation failed: Resource temporarily unavailable
Working on SSH but not on PHP
-
- Posts: 9
- Joined: 2012-04-25T07:37:26-07:00
- Authentication code: 13
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Working on SSH but not on PHP
I am not an expert on this, but perhaps php is using a different/older version of libgomp or perhaps does not have it built. I would check with your ISP. Why is it temporarily unavailable? Perhaps you server is overloaded?
But I will defer to the IM developers on this.
But I will defer to the IM developers on this.
Re: Working on SSH but not on PHP
You can use this method to display errors although the error is sometime not what it seems:
Code: Select all
echo "<pre>";
exec("/kunden/homepages/39/d296597816/htdocs/imagick6.7/bin/convert input.jpg -scale 600x300 -background white -gravity center -extent 600x300 output.jpg 2>&1", $array);
echo "<br>".print_r($array)."<br>";
echo "</pre>";
-
- Posts: 9
- Joined: 2012-04-25T07:37:26-07:00
- Authentication code: 13
Re: Working on SSH but not on PHP
I dont know if this have any sense but i fixed it (it seems to be) installing imagemagick with ./configure --without-threads and then make && make install
And now its working.
And now its working.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Working on SSH but not on PHP
Yes sometimes different systems do not work well with OpenMP. So disabling OpenMP or turning off threads (setting threads to 1) can help.carlosgoce wrote:I dont know if this have any sense but i fixed it (it seems to be) installing imagemagick with ./configure --without-threads and then make && make install
And now its working.
Glad you were able to solve it. This is the first time I have seen that problem with threading using PHP. I am not sure if it is really related to PHP or just to what machine you are running IM with multi-threading or not.