Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php_fpm possible conflict. #76

Closed
postadelmaga opened this issue Jan 8, 2015 · 6 comments
Closed

php_fpm possible conflict. #76

postadelmaga opened this issue Jan 8, 2015 · 6 comments

Comments

@postadelmaga
Copy link

I have integrated this tool with a web app. based on php.
I have tested it on my local env, based on mod_php and I have no issue but when I deploy the stuff to live server image_optim is not compressing the images.
The live server uses php_fpm and I suspect this is the reason because of the issue ...

Do you have any idea how can I debug it ?
I'm executing image_optim using php exec() ... the strange thing is I got not error, the output show 0 optimization that's it. But If I try to optimize the same image in my local environment the image get reduced.

@toy
Copy link
Owner

toy commented Jan 8, 2015

You can check output of image_optim --info, compare with output of same command in local environment, don't miss stderr.
Also you can add --verbose to optimization command and also analyse output.

@toy
Copy link
Owner

toy commented May 2, 2015

@postadelmaga Do you have any input on this?

@postadelmaga
Copy link
Author

image_optim --info didn't show any difference ...
I could not find any workaround so I had to drop the use of image_optim (I have written some similar functionality directly in my php application ) since it was not compatible with the server environment and I'm not managing the server.

@toy
Copy link
Owner

toy commented May 4, 2015

I am sorry to hear that. Please reopen the issue if you will reconsider and would like to investigate the issue.

@toy toy closed this as completed May 4, 2015
@HansVanEijsden
Copy link

HansVanEijsden commented Nov 29, 2017

I have the same problem and would like to open this issue.

I use image_optim v0.26.0 and all goes well from the shell. From PHP it also works, but it barely optimizes the images and it also doesn't find svgo and pngout when executed from php, although I have installed them and they can be found from the shell (also from the same user as the php user): that's the visible difference in the --info output.
I tried using a simple wrapper bash script: no luck, still the missing svgo and pngout binaries when executed through php.

PHP 7.1.12, Linux 4.13.0-0.bpo.1-amd64 #1 SMP Debian 4.13.13-1~bpo9+1 (2017-11-22) x86_64 GNU/Linux
Just ask if you want to know more.

Edit: Solved! I had to uncomment this in the php-fpm pool config:
env[PATH] = /usr/local/bin:/usr/bin:/bin

@toy
Copy link
Owner

toy commented Nov 29, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants