Wired problem to run Fred's Scripts in PHP
Posted: 2014-09-23T08:26:39-07:00
I'm trying to run Fred's Scripts in PHP using exec. It works correctly for text in short length. However when the text becomes longer, the result is not correct.
Here is the PHP code and the $output is always empty, no error message.
Here is the $cmd to run. This is short text.
The result is correct. See this image:
Now let's try longer text. Here is the $cmd to run.
The result is NOT correct. See this image:
Let's try much longer text. Here is the $cmd to run.
No image was created any more.
I ran these commands in SSH client and ALL the images are created correctly, even the longest text. Please see this image.
Anyone knows what the problem is? Thank you,
Here is the PHP code and the $output is always empty, no error message.
Code: Select all
exec($cmd,$output);
print_r($output);
Code: Select all
$cmd = "bash ~/etc/texteffect -t '1 long text 2 long text 3 long text' -s plain -e arc-top -a 180 -f font/foo.ttf -p 50 -c black -b none -l 1 -u none output.png";
Now let's try longer text. Here is the $cmd to run.
Code: Select all
$cmd = "bash ~/etc/texteffect -t '1 long text 2 long text 3 long text 4 long text 5 long text' -s plain -e arc-top -a 180 -f font/foo.ttf -p 50 -c black -b none -l 1 -u none output.png";
Let's try much longer text. Here is the $cmd to run.
Code: Select all
$cmd = "bash ~/etc/texteffect -t '1 long text 2 long text 3 long text 4 long text 5 long text 6 long text 7 long text 8 long text 9 long text 10 long text' -s plain -e arc-top -a 180 -f font/foo.ttf -p 50 -c black -b none -l 1 -u none output.png";
I ran these commands in SSH client and ALL the images are created correctly, even the longest text. Please see this image.
Anyone knows what the problem is? Thank you,