PHP-FPM loaded configuration and reseting PHP version to the lowest one

  1. I am playing with "PHP script execution mode" in "Website and PHP options section" by switching from FCGId to FPM. Loading phinfo file in browser I am getting the following results.

[PHP INFO FCGI]

Server API = CGI/FastCGI
Loaded Configuration = /home/mydomain/etc/php7.0/php.ini

[PHP INFO FPM]

Server API = FPM/FastCGI
Loaded Configuration = /etc/php/7.0/fpm/php.ini

Question 1: Is it possible to change Loaded Configuration in FPM to /home/[virtualhost_name]/etc/php.ini?

Question 2: In case it is no possible and if I have to override some php values from the Loaded Configuration I guess I have to edit the file /etc/php[version]/fpm/pool.d/[number].conf. Values format are like this "php_admin_value[allow_url_fopen] = 0". Can I insert these values in Virtualmin interface only for that virtual host?

  1. I am using always PHP 7.0, but 5.6 is installed too. When I am switching back from FPM to FCGI Virtualmin is reseting PHP version to 5.6 instead of keeping the one used in FPM. In my opinion this is a bug.
Status: 
Closed (fixed)

Comments

For now only 1 FPM PHP version is supported.

Search forum for multiple you see maybe next version... ;)

If allowed you can also do some php.ini values with user.ini

I am sorry to say but you did not read quite my report. I was not looking for using multiple PHP-FPM versions.

Howdy -- the behavior you're seeing there is expected.

It's just using the default PHP version for your server, which is configurable in the Server Templates.

However, since PHP-FPM only has one PHP version it can use, that may be a different version than the default PHP version.

Folks seem to want different behaviors there, so what you can do is configure the Server Template to default to your preferred PHP version.

It looks like you're using Virtualmin GPL there though, so if you had additional questions on configuring that, and for the other questions mentioned in your post, we'd encourage you to use the Forums for obtaining support.

We monitor the Forums, along with lots of wonderful folks in the community. Thanks!

I mean this is for Virtualmin kind of the same as trying multiple the behaviour: I am using always PHP 7.0, but 5.6 is installed too. When I am switching back from FPM to FCGI Virtualmin is reseting PHP version to 5.6 instead of keeping the one used in FPM. In my opinion this is a bug.

That is my experience and how i think about that switching to default combi. So not supported yet, is comming sofar you can read on this forum.

With regret I have to admit nobody is reading a report carefully. By experience, if someone is asking something about anything I will read first the question then I will consider if I can answer or not. If I answer I will try to give a proper answer.

@andreychek: Using Server Templates will affect all virtual hosts. It is clear to me the only way to set up php values is not in a php.ini file for a virtual host. I have to edit manually the file in pools.d folder. I already did this and this is the way. Virtualmin is not allowing me to edit this file in its interface. This was my initial report.

@jfro: Switching from FPM to FCGI is changing PHP version to the lowest version. If you are not checking what version of php is using you can use 5.6 instead of 7.1. This is my report. People should be warn when switching back to FCGI to check PHP Versions too. Even I am an advanced system engineer for two days I worked in a Magento 1 with 5.6 instead of 7.0.33.

Me to sorry misunderstanding

I am saying and support virtualmin also. This is for the moment the behaviour if using one PHP fpm, ( this what you have is my experience to and forum you can find more, sometimes pointing out multiple PHP fpm versions and so on

( i did have this with 5.6 fpm switching then after change to 7..) But you can try with setting other basic default version if free version you can test some more configs. i think

They are resulting with this kind of behaviour because not supported yet!

I don't know how to explain in other way

Also here there is Manage PHP Configuration /etc/php-fpm.d/yourssss.conf (FPM format)

in Virtualmin virtualserver >services >php-fpm-configuration you have the GUI to set things This page can be used to manually edit a PHP configuration file. This should be done carefully, as no syntax or other validity checking will be performed on your changes

Otherwise you can set Virtualmin templates to have some default virtualserver settings there.

If Apache you can also if allowed use a user.ini for some php settings

i'm using listen with different nr's ofcourse not sure if a changed them manually to be working well?!? listen = 8001 and so on

But you have to go and read forum guidelines i think, here are you in paying Customers forum part! https://www.virtualmin.com/node/53663 So posting version nrs and so on ;)

@andreychek: Using Server Templates will affect all virtual hosts. It is clear to me the only way to set up php values is not in a php.ini file for a virtual host. I have to edit manually the file in pools.d folder. I already did this and this is the way. Virtualmin is not allowing me to edit this file in its interface. This was my initial report.

Yup, that's the way PHP-FPM works. You can only have one php.ini file, the system-wide version. And because of that, you can't make changes using the GUI... if that were possible, a Virtual Server owner could change values that would be used by other domains.

It doesn't sound like you're experiencing a bug, it sounds like you have some questions on how PHP-FPM works.

Which is perfectly fine, but the best place to ask those questions is in the Forums :-)

I'm going to go ahead and mark this as closed -- please feel free to use the Forums for support, there's lots of experienced folks who monitor those. Thanks!