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

not possible to specify a custom php.ini file? #535

Open
g4z opened this issue Feb 9, 2021 · 3 comments
Open

not possible to specify a custom php.ini file? #535

g4z opened this issue Feb 9, 2021 · 3 comments
Labels

Comments

@g4z
Copy link

g4z commented Feb 9, 2021

this is more of a question because i didn't find any other resource to find this information.

is it possible to tell ppm to use a specific config file (php.ini) in the ppm.json config file for ppm?

for example, there already exists this option...

"cgi-path": "/usr/bin/php"

does something like this exist? or an alternative to achieve the same thing.

"ini-path": "/etc/php7/php-ppm.ini"

thanks

@acasademont
Copy link
Contributor

Hi @g4z I believe you could use the PHPRC environment variable as documented in the PHP docs to point to a folder where you have your custom php.ini

https://www.php.net/manual/en/configuration.file.php

And call ppm like PHPRC=/path/to/your/ini/folder bin/ppm. Haven't tried it myself but I believe this should work, let me know!

@g4z
Copy link
Author

g4z commented Feb 9, 2021

hi. fast reply!

i created the config file at /etc/php7/ppm/php.ini and start ppm like this...

PHPRC=/etc/php7/ppm /ppm/vendor/bin/ppm start --config=/ppm/ppm.json /srv

i'm still getting the same result as before. ie. it seems the workers are still using the default /etc/php7/php.ini config.

i guess setting PHPRC at this "level" will ensure that PPM starts using this PHPRC value, but will this propogate down to the workers?

maybe i'm even confused about which processes use which php.ini. i'm assuming that (in my scenario) the PPM process itself can use a certain php.ini (ie. /etc/php7/ppm/php.ini) but the worker processes can use another php.ini (eg. /etc/php7/worker/php.ini)

i have a bit of a strange setup. i'm trying to integrate PPM into an existing setup.

i will look into this further soon, but i got sidetracked right now.

thanks for the suggestion.

@acasademont
Copy link
Contributor

You're right, as the workers are started as independent processes from the main one, the PHPRC directive is probably not propagated, we should investigate that.

As a workaround, the worker processes use php-cgi and a php-cgi.ini will take preference over php.ini. Assuming you don't have any more php-cgi stuff, you could probably use that. Could that work?

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

No branches or pull requests

2 participants