Submitted by Shirehosting on Fri, 07/30/2010 - 21:43 Pro Licensee
Just a quick question, how do I assign different PHP.ini files to individual Virtual servers.
The reason I ask is that I migrated one of my customers virtual servers from an older CENTOS 5 install to a new ubuntu 10.04LTS build and for some reason it is using the global PHP.ini file for the Drupal website PHP defaults. Prior to that it was using it's own.
Thanks in advance
Status:
Closed (fixed)
Comments
Submitted by JamieCameron on Sat, 07/31/2010 - 02:55 Comment #1
When you switch a virtual server to fcgid or cgi mode for running PHP scripts (at Server Configuration -> Website Options), it will use its own php.ini file, located at etc/php5/php.ini under the domain's home.
Only when mod_php mode is used will a single global php.ini be used.
Submitted by Shirehosting on Sat, 07/31/2010 - 03:47 Pro Licensee Comment #2
FCGId (run as virtual server owner)
is set for the server but yet it is still using the global apache PHP.ini
Submitted by JamieCameron on Sat, 07/31/2010 - 03:50 Comment #3
Are you sure? Which particular PHP setting is coming from the global config?
Submitted by Shirehosting on Sat, 07/31/2010 - 06:02 Pro Licensee Comment #4
all of them
Submitted by JamieCameron on Sat, 07/31/2010 - 09:42 Comment #5
How are you testing this exactly?
Submitted by Shirehosting on Sun, 08/01/2010 - 05:46 Pro Licensee Comment #6
i run a small test.php script containing
this indicates to me that /etc/php5/apache2/php.ini is being used
also when i make changes to the local virtual servers php.ini they are not reflected in the virtual servers website
Submitted by Shirehosting on Sun, 08/01/2010 - 05:48 Pro Licensee Comment #7
"phpinfo( ) "
Submitted by Shirehosting on Sun, 08/01/2010 - 09:08 Pro Licensee Comment #9
Jamie, any Ideas, I'm at my wits end trying to figure this out
Submitted by JamieCameron on Sun, 08/01/2010 - 18:25 Comment #10
Did you try my previous comment (number 8) ?
Submitted by Shirehosting on Sun, 08/01/2010 - 19:16 Pro Licensee Comment #11
Sorry can't try it because when I look at the comments section above my numbering goes 1,2,3,4,5,6,7,9,10
comment 8 is missing for some reason.
Submitted by JamieCameron on Sun, 08/01/2010 - 19:18 Comment #12
Wierd! What I wrote was :
Ok, I remember the cause of this now .. it is specific to Ubuntu 10. You need to edit the file /etc/apache2/mods-available/php5.conf and comment out all the SetHandler lines, then restart Apache.
Submitted by JamieCameron on Sun, 08/01/2010 - 19:18 Comment #13
Wierd! What I wrote was :
Ok, I remember the cause of this now .. it is specific to Ubuntu 10. You need to edit the file /etc/apache2/mods-available/php5.conf and comment out all the SetHandler lines, then restart Apache.
Submitted by JamieCameron on Sun, 08/01/2010 - 19:19 Comment #14
Wierd! What I wrote was :
Ok, I remember the cause of this now .. it is specific to Ubuntu 10. You need to edit the file /etc/apache2/mods-available/php5.conf and comment out all the SetHandler lines, then restart Apache.
Submitted by JamieCameron on Sun, 08/01/2010 - 19:28 Comment #15
Wierd! What I wrote was :
Ok, I remember the cause of this now .. it is specific to Ubuntu 10. You need to edit the file /etc/apache2/mods-available/php5.conf and comment out all the SetHandler lines, then restart Apache.
Submitted by JamieCameron on Sun, 08/01/2010 - 19:29 Comment #16
Wierd! What I wrote was :
Ok, I remember the cause of this now .. it is specific to Ubuntu 10. You need to edit the file /etc/apache2/mods-available/php5.conf and comment out all the SetHandler lines, then restart Apache.
Submitted by Shirehosting on Sun, 08/01/2010 - 19:43 Pro Licensee Comment #17
Fantastic, worked like a charm. Thanks
Also do you know why this is set that way in Ubuntu 10.04?
Submitted by JamieCameron on Sun, 08/01/2010 - 19:50 Comment #18
No idea why Ubuntu does that .. but future versions of the Virtualmin installer will remove that SetHandler line automatically.
Submitted by Shirehosting on Sun, 08/01/2010 - 19:56 Pro Licensee Comment #19
cool once again thanks.
Submitted by Shirehosting on Sun, 08/01/2010 - 23:50 Pro Licensee Comment #20
Hi Jamie,
I just ran into another problem associated with this issue. one of my Drupal sites all of a sudden began spitting out when I applied your fix
The directory sites/default/files/css is not writable, because it does not have the correct permissions set.
and when I look at the permissions associated with this directory it is writable, also the other problem that occurs is that the webFM module that the website uses for handling files sees all the files as read only no matter what I do in the file system
Thanks
Submitted by JamieCameron on Mon, 08/02/2010 - 00:24 Comment #21
What PHP execution mode do you have set for the domain with that Drupal site?
Submitted by Shirehosting on Mon, 08/02/2010 - 05:58 Pro Licensee Comment #22
FCGId (run as virtual server owner) is set on the virtual server as well as Ruby scripts disabled
Submitted by JamieCameron on Tue, 08/03/2010 - 01:48 Comment #23
Ok, that should allow writing.
What actually are the permissions on the directory mentioned in that error message from drupal?
Submitted by Shirehosting on Tue, 08/03/2010 - 04:52 Pro Licensee Comment #24
The permissions on the files directory is 775 and 664 on the files themselves.
the issue seems to occur when I comment out the SetHandler statments and the virtual servers begin using there own PHP.ini files
Submitted by JamieCameron on Tue, 08/03/2010 - 06:02 Comment #25
Does it help if you completely remove that file (the one you commented out the directives in) and then restart Apache?
Submitted by Shirehosting on Thu, 08/05/2010 - 17:54 Pro Licensee Comment #26
Haven't been able to test this yet, will give it a go tonight.
Submitted by shinji on Tue, 08/10/2010 - 17:50 Comment #27
Just an FYI (and I posted in the other bug report as well for this) the issue is probably because mod_php5 is running. For some reason mod_php5 overrides mod_fcgid so that is why the global php.ini file is being used. If you do not use mod_php5 at all anywhere then I would disable the module and see if the issue goes away. You will find it at Webmin -> Servers -> Apache Webserver -> Global Configuration -> Configure Apache Modules then remove the checkmark next to php5 and click Enable Selected Modules.
It was the only way I got rid of the issue. The website configs looked fine but I'm not sure if there was any intention to be able to run both mod_php5 and mod_fcgid on the same apache server configuration.
Submitted by Shirehosting on Wed, 08/11/2010 - 11:07 Pro Licensee Comment #28
Thanks Problem is now sorted :-)
Submitted by JamieCameron on Wed, 08/11/2010 - 12:26 Comment #29
Great!
Submitted by Issues on Fri, 08/27/2010 - 02:21 Comment #30
Automatically closed -- issue fixed for 2 weeks with no activity.