Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 11 of 11
  1. #1
    Member
    Join Date
    Nov 2003
    Posts
    50

    Default 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

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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.

  3. #3
    Member
    Join Date
    Nov 2003
    Posts
    50

    Default

    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?

  4. #4
    Member
    Join Date
    Sep 2004
    Posts
    887

    Default

    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

  5. #5
    Member
    Join Date
    Nov 2003
    Posts
    50

    Default

    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.

  6. #6
    Member
    Join Date
    May 2004
    Posts
    116

    Default

    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....

  7. #7
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,768
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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

  8. #8
    Member
    Join Date
    Nov 2003
    Posts
    50

    Default

    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

  9. #9
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,768
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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.

  10. #10
    Member
    Join Date
    Nov 2003
    Posts
    50

    Default

    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?

  11. #11
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,768
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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.

Similar Threads & Tags
Similar threads

  1. apache 2 + php4&5 - php5 files not being parsed
    By DBJoshua in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-18-2007, 10:19 AM
  2. PHP4+PH5 not working with apache 1.3.37
    By omenix in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-10-2006, 06:15 PM
  3. php4.4.4 Zend 3 & Apache problem
    By chae in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 09-04-2006, 12:42 PM
  4. apache failed after php4.3.9
    By xml in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 11-24-2004, 05:44 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube