Downgrading PHP 5.3 to 5.2
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 12 of 12
  1. #1
    Join Date
    Jul 2009
    Location
    Pittsburgh, PA
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Downgrading PHP 5.3 to 5.2

    I need to downgrade the PHP on my Fedora 12 machine from 5.3.1 to 5.2...how do I do this?

    ---------- Post added at 11:34 AM CST ---------- Previous post was at 10:33 AM CST ----------

    ran 'yum downgrade php php-common php-cli' but can't get lower than 5.3.0.

  2. #2
    Join Date
    Feb 2009
    Posts
    2,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP 5.2 is not in the Fedora repositories. However, you may get it from different sources.

  3. #3
    Join Date
    Apr 2010
    Location
    The Netherlands
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Downgrading PHP 5.3 to 5.2

    I recommend you to install PHP 5.2 through source.

    Before you proceed first make sure you have the right packages installed to compile from source. Probably the easiest way to do it as following:

    # stop apache
    /etc/init.d/httpd stop

    # remove PHP 5.3 RPM
    yum remove php
    # install packages to compile from source
    yum groupinstall "Development Tools"
    yum install httpd-devel
    yum install libxml2-devel
    yum install mysql-devel

    # download PHP 5.2.13 Source from www.php.net
    # after that extract the tar file:
    tar -zxvf php-5.2.13.tar.gz
    cd php-5.2.13
    ./configure --with-apxs2=/usr/sbin/apxs --with-mysql=/usr/local
    make
    make test (not neccessary)
    make install

    # hopefully the compilation is succesfully completed
    # now copy the default php.ini
    cp php.ini-recommended /usr/local/lib/php.ini

    # edit php ini
    vi /usr/local/lib/php.ini
    # change this:
    short_open_tag = Off
    # to:
    short_open_tag = On
    # save the document

    # edit your Apache http.conf to allow .php files to be parsed
    vi /etc/httpd/conf/httpd.conf
    # add the following lines:
    LoadModule php5_module modules/libphp5.so
    <FilesMatch \.php$>
    SetHandler application/x-httpd-php
    </FilesMatch>
    # save the document
    # restart apache
    /etc/init.d/httpd restart

    Enjoy PHP 5.2.X!

    Kind regards,

    Bas van Beek

  4. #4
    Join Date
    Apr 2010
    Location
    The Netherlands
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Downgrading PHP 5.3 to 5.2

    If you are missing some functionalities like Exif and Curl then configure your command as follows:

    # installing the additional packages
    yum install libcurl libxml2-devel openssl-devel bzip2-devel curl-devel libjpeg-devel libpng-devel freetype-devel gmp-devel libiconv iconv libxslt-devel libstdc++-devel libmcrypt

    # configuring PHP before installing it
    ./configure --with-apxs2=/usr/sbin/apxs --with-mysql=/usr/local \
    --with-kerberos=/usr \
    --enable-cli \
    --with-zlib-dir=/usr \
    --enable-exif \
    --enable-ftp \
    --enable-mbstring \
    --enable-mbregex \
    --enable-sockets \
    --with-curl \
    --with-openssl=/usr \
    --with-xmlrpc \
    --with-xsl=/usr \
    --with-pear \
    --with-iconv \
    --with-gd \
    --with-jpeg-dir=/opt/local \
    --with-png-dir=/opt/local \
    --with-freetype-dir=/opt/local \

    Now proceed the steps that I mentioned in my previous post.

    Let me know if it's helping.

    Best regards,

    Bas van Beek

  5. #5
    Join Date
    Jun 2006
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Downgrading PHP 5.3 to 5.2

    Is there no way to do this with yum? I need to do this with php-mysql and lots of other stuff and the idea of compiling for everything I need does not appeal!

    If I choose another repository that has 5.2 but is for maybe fc10 will that work or am I leaving myself open to conflicts.

    Thanks,

    Andrew

  6. #6
    Join Date
    Apr 2010
    Location
    The Netherlands
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Downgrading PHP 5.3 to 5.2

    I know what your challenging, believe me.

    Using packages from a newer repo is not the right solution. The files are simply not compiled for your FC release.

    You can, however, try to manually upgrade your FC release. It's not impossible to update it. But officially it's not supported.

    Installing from source is not hard. If you follow my previous post it's even more easy. Just follow the command lines in the right order and you would have a fresh and good compiled version of PHP running in combination with MySQL.

    Best Regards,

    Bas

  7. #7
    Join Date
    Jun 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Downgrading PHP 5.3 to 5.2

    Should I remove the "Development Tools" after I'm done with the install?

    ---------- Post added at 04:43 AM CDT ---------- Previous post was at 04:37 AM CDT ----------

    Quote Originally Posted by bvbmedia
    If you are missing some functionalities like Exif and Curl then configure your command as follows:

    # installing the additional packages
    yum install libcurl libxml2-devel openssl-devel bzip2-devel curl-devel libjpeg-devel libpng-devel freetype-devel gmp-devel libiconv iconv libxslt-devel libstdc++-devel libmcrypt

    # configuring PHP before installing it
    ./configure --with-apxs2=/usr/sbin/apxs --with-mysql=/usr/local \
    --with-kerberos=/usr \
    --enable-cli \
    --with-zlib-dir=/usr \
    --enable-exif \
    --enable-ftp \
    --enable-mbstring \
    --enable-mbregex \
    --enable-sockets \
    --with-curl \
    --with-openssl=/usr \
    --with-xmlrpc \
    --with-xsl=/usr \
    --with-pear \
    --with-iconv \
    --with-gd \
    --with-jpeg-dir=/opt/local \
    --with-png-dir=/opt/local \
    --with-freetype-dir=/opt/local \

    Now proceed the steps that I mentioned in my previous post.

    Let me know if it's helping.

    Best regards,

    Bas van Beek

    I tried the above, but I get

    configure: error: Cannot find OpenSSL's libraries

    (I'm running fedora 13)

  8. #8
    Join Date
    Apr 2010
    Location
    The Netherlands
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Downgrading PHP 5.3 to 5.2

    You could try to install the development package of OpenSSL by running:

    yum -y install openssl-devel

    Let me know if it helps.

    Best regards,

    Bas van Beek

    ---------- Post added at 04:53 PM CDT ---------- Previous post was at 04:52 PM CDT ----------

    Here another 1 line based command for bypassing those issues:

    yum -y install libcurl libxml2-devel openssl-devel bzip2-devel curl-devel libjpeg-devel libpng-devel freetype-devel gmp-devel libiconv iconv libxslt-devel libstdc++-devel libmcrypt freetype-devel freetype libxslt-devel libpng* libjpeg*

  9. #9
    Join Date
    Oct 2009
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Downgrading PHP 5.3 to 5.2

    What's the big problem with php 5.3.x guys?

    Thanks,
    Zanpactou

  10. #10
    Join Date
    Apr 2010
    Location
    The Netherlands
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Downgrading PHP 5.3 to 5.2

    In PHP 5.3 ereg is deprecated. Many old web-applications will fail because of this.

    Best Regards,

    Bas van Beek
    BVB Media

  11. #11
    Join Date
    Oct 2009
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Downgrading PHP 5.3 to 5.2

    Quote Originally Posted by bvbmedia
    In PHP 5.3 ereg is deprecated. Many old web-applications will fail because of this.

    Best Regards,

    Bas van Beek
    BVB Media
    OK. Fair enough.
    Some other stuff was depreciated too but the depreciated warning for ereg and others was in previous versions before ereg was removed, do people not check their php logs?
    Or is it that people can't be bothered with swapping ereg out for one of the safer and faster regular expression functions in the current php release?

    Thanks,
    Zanpactou

  12. #12
    Join Date
    Nov 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Downgrading PHP 5.3 to 5.2

    Quote Originally Posted by Zanpactou
    What's the big problem with php 5.3.x guys?
    No problems. Just #!#@$ hosting companies
    that don't allow you to upgrade

Similar Threads

  1. Downgrading my KDE
    By Antikorper in forum Using Fedora
    Replies: 2
    Last Post: 12th June 2008, 08:14 PM
  2. Downgrading using yum
    By carlg in forum Using Fedora
    Replies: 0
    Last Post: 28th November 2007, 04:22 AM
  3. Downgrading from 64-bit to 32-bit
    By Jim Rockford in forum Using Fedora
    Replies: 4
    Last Post: 8th October 2006, 03:41 AM
  4. Downgrading from FC5 to FC4
    By mick-porter in forum Using Fedora
    Replies: 1
    Last Post: 29th March 2006, 10:41 PM

Tags for this Thread

Posting Permissions

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