The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php 5.2.17 and php 5.3.8? (not a feature request, but a request for help)

Discussion in 'General Discussion' started by MACscr, Sep 20, 2011.

  1. MACscr

    MACscr Well-Known Member

    Joined:
    Sep 30, 2003
    Messages:
    190
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    So i have a system that currently is running php 5.3.8 as suphp. Have a long time client on that system that found out recently his outdated cart requires php 5.2.x until it can be upgraded. Im wanting to setup php 5.2.x for him to use a couple months until he can get his update scheduled, etc. I was give some general advice from a friend:

    I honestly havent compiled php from scratch, at least not in this type of environment. Ive got the source downloaded from php.net and extracted into the correct folder. Is there an easy way for me to figure out whats configured with php 5.3.8 so that the same options (obviously stuff thats still compatible with 5.2.x) can be used to configure php 5.2.17? Also, what do i need to do so that i can setup this php version to be the default php handler just for him?

    Any help and especially detailed instructions would be sincerely appreciated. Im only a one man shop and i have another large project that is due in the next 36 hours, so have to concentrate on that, but I would like to be able to get this other client with the php issue back to a fully functional site as soon as possible, thus my call out for help. Thanks!
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,455
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Re: php 5.2.17 and php 5.3.8? (not a feature request, but a request for hel

    Have you seen the Feature Request thread on this topic? Multiple PHP 5.x versions
     
  3. MACscr

    MACscr Well-Known Member

    Joined:
    Sep 30, 2003
    Messages:
    190
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Re: php 5.2.17 and php 5.3.8? (not a feature request, but a request for hel

    Yes, hence why i said this wasnt a feature request and why i am looking for instructions for doing it manually and without EA.
     
  4. sirdopes

    sirdopes Well-Known Member
    PartnerNOC

    Joined:
    Sep 25, 2007
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    Re: php 5.2.17 and php 5.3.8? (not a feature request, but a request for hel

    Download the source and extract. Run something like the following configure line and then make and make install.

    Code:
    ./configure  --enable-bcmath --enable-calendar --enable-dbase --enable-exif --enable-fastcgi --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-magic-quotes --enable-mbstring --enable-pdo=shared --enable-soap --enable-sockets --enable-sqlite-utf8 --enable-wddx --enable-zip --prefix=/opt/php52 --with-bz2 --with-curl=/opt/curlssl/ --with-freetype-dir=/usr --with-gd --with-gettext --with-imap=/opt/php_with_imap_client/ --with-imap-ssl=/opt/openssl --with-jpeg-dir=/usr --with-kerberos --with-libexpat-dir=/usr --with-libxml-dir=/opt/xml2 --with-libxml-dir=/opt/xml2/ --with-mcrypt=/opt/libmcrypt/ --with-mhash=/opt/mhash/ --with-mime-magic --with-mysql=/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/bin/mysql_config --with-openssl=/opt/openssl --with-openssl-dir=/opt/openssl --with-pcre-regex=/opt/pcre --with-pdo-mysql=shared --with-pdo-sqlite=shared,/usr --with-png-dir=/usr --with-pspell --with-sqlite=shared --with-tidy=/opt/tidy/ --with-ttf --with-unixODBC=/usr --with-xmlrpc --with-xpm-dir=/usr --with-xsl=/opt/xslt/ --with-zlib --with-zlib-dir=/usr --enable-intl 
    
    The configure options will vary depending on the options that you need.

    Edit the file /opt/suphp/etc/suphp.conf and look for the following section.
    Code:
    [handlers]
    ;Handler for php-scripts
    application/x-httpd-php4="php:/usr/php4/bin/php"
    application/x-httpd-php5="php:/usr/bin/php"
    application/x-httpd-php52="php:/opt/php52/bin/php-cgi"
     
    application/x-httpd-php52="php:/opt/php52/bin/php-cgi <-- this is the one that you want to add.

    In the file /usr/local/apache/conf/includes/pre_main_global.conf add:
    Code:
     AddType application/x-httpd-php52 .php52
    <Directory />
        suPHP_AddHandler application/x-httpd-php52
    </Directory>
    Then in your clients .htaccess you can use the following to use php 5.2.

    Code:
    AddType application/x-httpd-php52 .php
    
     
  5. JayFromEpic

    JayFromEpic Well-Known Member

    Joined:
    Apr 2, 2011
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Scottsdale, AZ
    cPanel Access Level:
    Root Administrator
    Re: php 5.2.17 and php 5.3.8? (not a feature request, but a request for hel

    What cart is he using if you dont mind me asking.

    Also, to my knowledge, 5.2.x is the only REAL stable version of PHP that will work fully with things such as Ioncube, Zend, and some other server side apps. I may be wrong but if I am, feel free to correct me.
     
  6. handsonhosting

    handsonhosting Well-Known Member

    Joined:
    Feb 17, 2002
    Messages:
    151
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Omaha, NE
    cPanel Access Level:
    Root Administrator
    Re: php 5.2.17 and php 5.3.8? (not a feature request, but a request for hel

    We have a few hundred servers operating PHP 5.3.x with IonCube and have no issues at all.
    Of course, Zend Optimizer would not work on the PHP 5.3 platform, so some users have opted to stay on our 5.2.x machines, but many users are using PHP 5.3 with IonCube and not seeing any issues. PHP 5.2 is stable, but PHP 5.3 is stable too. Be aware that PHP 5.2 is no longer supported by PHP - so really you shoudl be upgrading to the later release at this point.
     
  7. micho101

    micho101 Member

    Joined:
    Sep 29, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Re: php 5.2.17 and php 5.3.8? (not a feature request, but a request for hel

    @Sirdopes

    Great solution for us, who need to enable PHP 5.2.x for just a few sites with legacy PHP apps. Thanks.
     
Loading...

Share This Page