Updating CentOS server to PHP5 default

5 posts / 0 new
Last post
#1 Wed, 05/21/2008 - 08:43
ihistand

Updating CentOS server to PHP5 default

Hi all, can anyone tell me the steps needed to convert a CentOS server 4.6 to use PHP5 as the default on all web applications? Installing PHP5 is no problem, but I cannot seem to find a way to make it the one used by default.

Thanks a bunch, Ivan

Wed, 05/21/2008 - 08:49
Joe
Joe's picture

You haven't mentioned whether you're using Virtualmin Professional or GPL. Professional makes it switchable in the UI, GPL you have to decide for the whole system (or manually configure it for each virtual host).

You also haven't mentioned whether you're running PHP under mod_php or mod_fcgid+suexec.

--

Check out the forum guidelines!

Wed, 05/21/2008 - 09:52 (Reply to #2)
ihistand

I'm on Professional Virtualmin.... and also using mod_php

I suppose I'm blind, I don't see the UI option anywhere. But changing it for the whole system is no problem for me, if needed.

Thanks...
--Ivan

Wed, 05/21/2008 - 11:17 (Reply to #3)
Joe
Joe's picture

Switch to FCGId and you'll be able to choose between php4 and php5, as needed, assuming both are installed.

If you want to switch the mod_php version, just edit the appropriate php*.conf files in /etc/httpd/conf.d and uncomment the one you want and comment out the one you don't--note that you <b><i>MUST</i></b> comment out the other when you enable one. Apache will crash with mysterious error messages if you do not.

I'm being very emphatic, because it seems whenever I explain this process, folks enable the one they want without disabling the prior choice...and then come back asking why Apache doesn't work anymore. You cannot load mod_php4 and mod_php5 simultaneously.

Anyway, we recommend mod_fcgid and suexec. It's as fast as mod_php and adds security by running under suexec. But, you do have to modify permissions and ownership of any scripts you have running under mod_php--any apps that run under suexec have to be owned by the virtual server account, and they cannot be group or world writable (so, you want 755 or lower permissions on scripts, or they will not run--750 is probably the highest you should ever need to go, and even lower is better).

--

Check out the forum guidelines!

Wed, 05/21/2008 - 14:14 (Reply to #4)
ronald
ronald's picture

you are probably aware that webmin has (or had in the meantime) a bug that revealed the mysql root password in the Environment under mod_php.
to solve that look for &quot;variables_order= stanza&quot; in the php.ini, then update it to show &quot;GPCS&quot; thus taking out the &quot;E&quot; if not done already.

I discovered this when switching from mod_fgcid to mod_php on 1 domain..however Jamie would fix this in the next release so it might already be fixed.

Topic locked