#1 (permalink)  
Old 10-30-2007, 04:38 PM
Registered User
 
Join Date: Nov 2003
Posts: 49
JonathanLIVE
Apache 2.2 with PHP4

Can someone explain why PHP4 is not recommended with Apache2.2? We cannot move to PHP5 with too many scripts being incompatible... During install there is just a note from cpanel saying 'php4 not recommended' ... no idea just why not. Is it really not a good idea.. or is it alrlght?

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-30-2007, 04:49 PM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 7,995
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by JonathanLIVE View Post
Can someone explain why PHP4 is not recommended with Apache2.2? We cannot move to PHP5 with too many scripts being incompatible... During install there is just a note from cpanel saying 'php4 not recommended' ... no idea just why not. Is it really not a good idea.. or is it alrlght?

Thanks
PHP 4 was originally built with Apache 1's threading model in mind. That changed significantly with Apache 2, however PHP 4 did not. Unfortunately, now the two don't play well together. Not saying it wont work, just don't be surprised if you run into issues.
__________________
Want our technical analysts to login to your server to assist you? You can contact our technical analysts at: http://tickets.cPanel.net/submit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-30-2007, 04:52 PM
Registered User
 
Join Date: Nov 2003
Posts: 49
JonathanLIVE
Ok.. thats a start... but can you give me some idea as to what kind of issues?

If I compiled Apache 2.2 with PHP4 and FastCGI as the handler and mysql 4.1.. what issues could I expect from that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-30-2007, 05:34 PM
Registered User
 
Join Date: Sep 2004
Posts: 792
mtindor is on a distinguished road
Why don't you compile PHP4 and PHP5 both - set one to be the default and then test with the others. I realize you are worried that you will compile, then have problems with PHP4 because of it not working well with Apache 2.2 and then have problems with PHP5 because scripts may be incompatible. Is there some absolute need for you to move up to Apache 2.2?

Mike
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-30-2007, 05:51 PM
Registered User
 
Join Date: Nov 2003
Posts: 49
JonathanLIVE
I have done that with one server already. I have compiled with php4 and 5 and set php4 as the default.. but I have no need/use for php5 now and it seems like just a waste of system resources.

The move to Apache 2.2 is because the performance increase over 1.3 is huge.. very huge.. but too many scripts break in php5.

Has anybody done the config I mentioned above? I still am not clear as to what kind of issues I will face with apache2.2 and php4 other than what was said above that is just not specific enough for me to get a grasp as to how extensive an issue we are talking about.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 10-31-2007, 09:05 AM
Registered User
 
Join Date: May 2004
Posts: 110
bazzi is an unknown quantity at this point
we could get php4 work as cgi or fcgi. So we compiled php4 as module and php5 as fcgi.

You would be surprised how many scripts will work with php5. From al of our customers only one with a very old "post-nuke" script didn't work. SO we sayd to the client that we only support php4 till Q1 of 2008, because of the end of life of php5.
He totaly understaind and is now changing his website....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-02-2007, 04:22 PM
cpanelkenneth's Avatar
cPanel Quality Assurance
 
Join Date: Apr 2006
Posts: 3,222
cpanelkenneth is on a distinguished road
Quote:
Originally Posted by JonathanLIVE View Post
I have done that with one server already. I have compiled with php4 and 5 and set php4 as the default.. but I have no need/use for php5 now and it seems like just a waste of system resources.

The move to Apache 2.2 is because the performance increase over 1.3 is huge.. very huge.. but too many scripts break in php5.

Has anybody done the config I mentioned above? I still am not clear as to what kind of issues I will face with apache2.2 and php4 other than what was said above that is just not specific enough for me to get a grasp as to how extensive an issue we are talking about.
The issues arise when using mod_php (for version 4) and one of the Apache threaded MPMs. If you want to use mod_php with Apache 2.x, use the prefork MPM, it gives you the same behavior as Apache 1.3.

If you are using PHP via CGI, then you won't have issues (this includes via Fast CGI) particular to threading. See the following for more details:

http://www.php.net/manual/en/faq.ins...lation.apache2
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 11-02-2007, 05:44 PM
Registered User
 
Join Date: Nov 2003
Posts: 49
JonathanLIVE
Thanks that helps...

I have tried enabling FastCGI with PHP4 as the handler vs. dso .. however everytime I do it breaks scripts. I don't know exactly what difference it makes, but it appears scripts really do not like FastCGI handling PHP4. When running DSO they load normal.

I am noticing on some of my servers that with this config.. I am getting a LOT of Write sessions that seem to stay going for a long time before they are gracefully shutdown. Could this be a symptom of running PHP4 as the default and PHP5 as the second version with Apache2.2. For PHP5 I have FastCGI as the handler.

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 11-02-2007, 06:28 PM
cpanelkenneth's Avatar
cPanel Quality Assurance
 
Join Date: Apr 2006
Posts: 3,222
cpanelkenneth is on a distinguished road
Quote:
Originally Posted by JonathanLIVE View Post
Thanks that helps...

I have tried enabling FastCGI with PHP4 as the handler vs. dso .. however everytime I do it breaks scripts. I don't know exactly what difference it makes, but it appears scripts really do not like FastCGI handling PHP4. When running DSO they load normal.

I am noticing on some of my servers that with this config.. I am getting a LOT of Write sessions that seem to stay going for a long time before they are gracefully shutdown. Could this be a symptom of running PHP4 as the default and PHP5 as the second version with Apache2.2. For PHP5 I have FastCGI as the handler.

Thanks
It's possible the scripts are relying upon some settings in the VirtualHost or .htaccess files. Such settings are not (normally) available to a script executed via CGI.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 11-02-2007, 06:38 PM
Registered User
 
Join Date: Nov 2003
Posts: 49
JonathanLIVE
Actually.. the scripts that don't work tend to rely heavily on .htaccess. Since this is the situation does this mean that it would be preferable to disable prefork config in apache2.2 in order for php4 to run OK with it?

Does this mean that .htaccess will only run properly under apache2.2 with php5 enabled as the default with FastCGI?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 11-02-2007, 06:41 PM
cpanelkenneth's Avatar
cPanel Quality Assurance
 
Join Date: Apr 2006
Posts: 3,222
cpanelkenneth is on a distinguished road
Let me rephrase:

To use settings in .htaccess files in your PHP scripts, you need to use mod_php.

If you want/need to use PHP 4 as mod_php with Apache 2.2 (in order for the settings in .htaccess to work), then you need to use the prefork MPM, as it is not a threaded MPM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:28 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc