Page 1 of 3 123 LastLast
Results 1 to 20 of 52

Thread: How to install PHP 5.2 and 5.3 together

  1. #1
    Join Date
    Jan 2011
    Posts
    7

    How to install PHP 5.2 and 5.3 together

    I've searched the forum and found info about installing PHP 5.2 and 5.3 together. What I miss is a simple guide how to establish this.

    What I'm looking for is a simple guide how to install PHP 5.2 and PHP 5.3 together where PHP 5.2 is default and PHP 5.3 can be enabled through the following line:

    Code:
    # .htaccess
    
    AddHandler application/x-httpd-php53 .php
    • PHP 5.2 (default)
    • PHP 5.3 (htaccess)


    (Thus not with "x-httpd-php6" to fool DA that it's PHP 6 but it is PHP 5.3)

    Has anyone the knowledge to establish this and make a simple guide? Martynas (smtalk) maybe?

  2. #2
    Join Date
    Jan 2011
    Posts
    7

  3. #3
    Join Date
    Aug 2006
    Location
    LT, EU
    Posts
    7,310
    Yes, it is possible to do that. Use the same guide and execute the following afterwards:
    Code:
    perl -pi -e 's/x-httpd-php6/x-httpd-php53/' /usr/local/suphp/etc/suphp.conf
    perl -pi -e 's/x-httpd-php6/x-httpd-php53/' /etc/httpd/conf/extra/httpd-suphp.conf
    That's it! Good luck
    Martynas Bendorius
    MB Martynas IT. Professional server management company. Official DirectAdmin, CloudLinux, LiteSpeed and Comodo partners.

  4. #4
    Join Date
    Oct 2008
    Posts
    162
    So we should do the following commands to achieve this, is this correct?

    cd /usr/local/directadmin/custombuild
    ./build set custombuild 1.2
    ./build update
    mkdir -p custom/suphp
    cp -pf configure/suphp/configure.php5 custom/suphp/configure.php6
    perl -pi -e 's/php53/phprep/' versions.txt
    perl -pi -e 's/php6/php53/' versions.txt
    perl -pi -e 's/phprep/php6/' versions.txt
    ./build set php5_ver 5.2
    ./build set php6_cgi yes
    ./build set php5_cgi no
    ./build set php5_cli yes
    #set php6-cgi (or cli) to yes in the options.conf
    ./build php n
    mv -f /usr/local/php6 /usr/local/php6_old
    ln -s /usr/local/php5 /usr/local/php6
    perl -pi -e 's/x-httpd-php6/x-httpd-php53/' /usr/local/suphp/etc/suphp.conf
    perl -pi -e 's/x-httpd-php6/x-httpd-php53/' /etc/httpd/conf/extra/httpd-suphp.conf
    If so, does this only work with suPHP and thus not with php-cli?

  5. #5
    Join Date
    Aug 2006
    Location
    LT, EU
    Posts
    7,310
    Correct. If you'd like to have PHP 5.3 as mod_php (CLI) and PHP 5.2 as CGI (with suPHP), then it's very easy to do that too, you'd just need to modify a few steps.
    Martynas Bendorius
    MB Martynas IT. Professional server management company. Official DirectAdmin, CloudLinux, LiteSpeed and Comodo partners.

  6. #6
    Join Date
    Jan 2011
    Posts
    7
    smtalk, can you tell us what to do when updating DA?

    Suppose you have 25+ servers and when you update DA, the change for PHP 5.3 next to 5.2 is undone with every update of DA. Is there a way to keep the extra config during update of DA automatically? You don't want to update every server by hand only for the second PHP support.

    So basically my question is how to update DA with PHP 5.2 AND 5.3 automatically?

  7. #7
    Join Date
    Aug 2006
    Location
    LT, EU
    Posts
    7,310
    Execute the following:
    Code:
    cd /usr/local/directadmin/custombuild
    ./build update
    perl -pi -e 's/php53/phprep/' versions.txt
    perl -pi -e 's/php6/php53/' versions.txt
    perl -pi -e 's/phprep/php6/' versions.txt
    ./build update_versions
    perl -pi -e 's/x-httpd-php6/x-httpd-php53/' /usr/local/suphp/etc/suphp.conf
    perl -pi -e 's/x-httpd-php6/x-httpd-php53/' /etc/httpd/conf/extra/httpd-suphp.conf
    If you'd like to update everything and have PHP 5.2+5.3 left.
    Martynas Bendorius
    MB Martynas IT. Professional server management company. Official DirectAdmin, CloudLinux, LiteSpeed and Comodo partners.

  8. #8
    Join Date
    Oct 2005
    Location
    Montreal - Canada
    Posts
    296
    i try to install

    php4 cgi yes
    php5 cgi yes
    php6 cgi yes ( instructions for have php5.3 )

    but its remove php4 cgi

    normal ?

    i need 3 php cgi
    Richard Lincourt
    RapideNET.ca

  9. #9
    Join Date
    Aug 2008
    Posts
    4,695
    Php 4 is eol you shouldnt be installing it.

  10. #10
    Join Date
    Sep 2011
    Posts
    2
    i did that and when i swith for php5.3 i get internal error and i cant see my page

    when i check the phpinfo in the base_dir is emty

    can u help my with that

    thenks

  11. #11
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    6,764
    Actually im facing a problem.

    version.txt is edited as described, but when i run build php n the script will donwload php 6... and version.txt go back to original...

    Any workaround?

    Regards
    SeLLeRoNe - Andrea Iannucci
    Head of Managed Service - Senior DevOps Engineer
    If you need my support write me an E-Mail to Support@CrazyNetwork.it

  12. #12
    Join Date
    Mar 2009
    Posts
    124
    Same here, custombuild downloads php6 and installs it. Followed your instructions, except using "php6" as cli and 5.2 as cgi.

    SeLLeRoNe have u resolved this?

  13. #13
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    6,764
    Nope i didnt, but ive gave customers a month of time for upgrade their websites and now ive moved to php 5.3

    There should be something "different" in build script that prevent this work-around to work correctly.

    Regards
    SeLLeRoNe - Andrea Iannucci
    Head of Managed Service - Senior DevOps Engineer
    If you need my support write me an E-Mail to Support@CrazyNetwork.it

  14. #14
    Join Date
    Mar 2009
    Posts
    124
    I think i found my issue.

    smtalk's guide was for 5.3 being as cgi and 5.2 as cli. As my case was the other way around, this line was the issue:

    cp -pf configure/suphp/configure.php5 custom/suphp/configure.php6

    had to do

    cp -pf configure/ap2/configure.php5 custom/ap2/configure.php6

    Seems to download 5.3 now, but havent yet finished the configuration so cant confirm it works.

  15. #15
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    6,764
    well my problem was in build file not in configuration... he was only downloading version 6 and never 5.2 with 5.3, so maybe you had a different issue i suppose...

    Regards
    SeLLeRoNe - Andrea Iannucci
    Head of Managed Service - Senior DevOps Engineer
    If you need my support write me an E-Mail to Support@CrazyNetwork.it

  16. #16
    Join Date
    Aug 2006
    Location
    LT, EU
    Posts
    7,310
    I need to find some time to rewrite CustomBuild to allow using few versions of PHP 5.x on the same server. SeLLeRoNe, make sure autover=no is set in the options.conf file.
    Martynas Bendorius
    MB Martynas IT. Professional server management company. Official DirectAdmin, CloudLinux, LiteSpeed and Comodo partners.

  17. #17
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    6,764
    Well i dont need it anymore now, but thanks

    yes it was on yes... should be nice to get this

    Code:
    ./build set autover no
    in installation instructions.

    Regards and thanks
    SeLLeRoNe - Andrea Iannucci
    Head of Managed Service - Senior DevOps Engineer
    If you need my support write me an E-Mail to Support@CrazyNetwork.it

  18. #18
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,578
    Quote Originally Posted by smtalk View Post
    I need to find some time to rewrite CustomBuild to allow using few versions of PHP 5.x on the same server.

    That would be really great.

  19. #19
    Join Date
    Feb 2005
    Location
    The Netherlands
    Posts
    368
    Wondering if Smtalk ever implemented that option now, would be nice to have indeed!

  20. #20
    Join Date
    Aug 2008
    Posts
    4,695
    why does it matter when 5.2 is eol

Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 56
    Last Post: 09-11-2014, 06:58 PM
  2. From a base install, which libraries are needed for a DA install?
    By beansbaxter in forum Installation / System Requirements
    Replies: 3
    Last Post: 10-15-2010, 11:53 AM
  3. Install DA Custom Install
    By cachorroyayo in forum General Technical Discussion & Troubleshooting
    Replies: 2
    Last Post: 09-24-2009, 10:49 AM
  4. New DirectAdmin install - trying to install PHP
    By TheSpecialOne in forum System-Level Technical Discussion
    Replies: 1
    Last Post: 02-25-2008, 12:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •