PHP configuration file for each server

Hello,

I’ve installed Virtualmin and added a few virtual servers with mostly default configuration. I was under the impression that each virtual server would load its own php.ini file located in $home/etc/php.ini.

This doenst seem to be the case though? All virtual servers are loading the default php.ini file located at “/etc/php5/apache2/php.ini”.

Im running Ubuntu 10.04 and have tried uncommenting the following line in "/etc/apache2/mods-available/php5.conf " : SetHandler application/x-httpd-php

My goal is to have all new virtual servers copying the default php.ini file to their home directory and loading this file for the php configuration. That would enable me to have error loggin turned on, on some sites and disabled on others.

Hope someone has a suggestion!

Kind regards,
Morten

Howdy,

Yup – by default, it should definitely be using $home/etc/php.ini. Also, the installer should automatically be commenting out that “SetHandler” line… if it’s not, is it possible that you’re using an older version install.sh? That is, did you recently download it from the site here?

However, the first place I think I’d check is to make sure that in Server Configuration -> Website Options, that the “PHP script execution mode” setting is set to either FCGID or CGI.

-Eric

Hi Eric,

Thanks alot for answering. I did not recently download the virtualmin from the site. It been a while (approx 6-8 months since installation) I just recently started added new serveres. Do you think I will be nessesary to upgrade? Or perhaps run the installation again?

PHP Script execution mode is set to FCGID so cant really figure out whats wrong :confused: Esspecielly if it should be default configuration to load $home/etc/php.ini :frowning:

Oh I see, you had installed awhile ago… no, I wouldn’t reinstall, these should all be things that can be corrected.

Though, it wouldn’t hurt to do an “apt-get update && apt-get upgrade” to make sure you’re using the latest version of things, if you hadn’t already.

You mentioned that you commented out the two “SetHandler” lines in the Apache php config… did you restart Apache after that? If Apache wasn’t restarted, it could still continue to cause the problem you’re seeing.

-Eric

Appriciate the suggestions, Eric. Unfortunaly none of it has seemed to help.
I’ve uncommented both SetHandler lines. I’ve done a apt-get update/upgrade and restarted apache.

Still phpinfo() reads:

Loaded Configuration File /etc/php5/apache2/php.ini
Scan this dir for additional .ini files /etc/php5/apache2/conf.d

I figure it should say: etc/php.ini instead since it relative to its working directory? Never the less, I changed some settings in the $home/etc/php5/php.ini and these are not included for the virtual server :frowning:

Once again, thank you for taking the time. If you, or anyone else has another suggestion I would be glad to hear from you :wink:

Kind regards,
Morten

When you look at your phpinfo() output, what is the “Server API” row set to? It’s near the top… mine says “CGI/FastCGI”. If it says something like “Apache Handler”, that means it’s using mod_php.

One thing you might try is to switch the PHP Execution Mode to use CGI, I’d be curious if that makes a difference.

-Eric

I have the same problem
Did you find a solution ?

Hi I’m also having this same problem. All my Virtual Servers just use /etc/php5/cgi/php.ini rather than their own php.ini files in home/domain/etc/php5/php.ini as they should. I’m running FastCGI

Did anybody find a fix?

Thanks

I also have the same problem, before the scripts are executed from /etc/php.ini and now run in the /etc of each domain, for example: /home/domain/etc/php7/php.ini