Forum Moderators: coopster

Message Too Old, No Replies

Ubuntu Natty PHP downgrade

ubuntu linux php

         

rob_lawless

12:05 pm on Jul 12, 2011 (gmt 0)

10+ Year Member



I posted the below message on ubuntuforums.org but have yet to receive a reply so I thought I would post it here also :::

The version of PHP installed on my Natty box is as follows :

php -v
PHP 5.3.5-1ubuntu7.2 with Suhosin-Patch (cli) (built: May 2 2011 23:18:30)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies


However I require the use of PHP 5.1.6 for a certain environment scenario, the below link shows how to downgrade to PHP 5.2 from 5.3 by switching the lucid with karmic repos & using apt-get update
[nickveenhof.be ]

A question to this forum is to go from PHP 5.3 to 5.1, can I apply the same procedure as mentioned in the above link with the Ubuntu repos for PHP 5.1? & if so which Ubuntu version repos do I need to replace with?


Thanks in advance for your help
Rob

rob_lawless

12:07 pm on Jul 12, 2011 (gmt 0)

10+ Year Member



sorry link seems to be broken, here is the working version

[nickveenhof.be ]

coopster

8:47 pm on Jul 13, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, rob_lawless.

You could always rename or remove your current PHP install and download the 5.1.6 release and install it manually, configure and reboot your HTTP server.

[php.net...]

rob_lawless

10:19 pm on Jul 14, 2011 (gmt 0)

10+ Year Member



Thanks for your suggestion
After uninstalling php 5.3 & apache 2.2 via apt-get remove, I then downloaded below
httpd-2.2.19.tar.gz
php-5.1.6.tar.gz

I then ran the following to install apache form the folder extracted above
./configure --enable-so --prefix=/usr/local/apache
make
sudo make install


All the above seemed to work fine

I then executed the following to install php 5.1.6 from the folder extracted above
./configure --with-apxs2=/usr/local/apache/bin/apxs --prefix=/usr/local/apache/php
make
sudo make install

Again all seemed fine

I then executed
sudo cp -p .libs/libphp5.so /usr/local/apache/modules/
cp -p php.ini-recommended /usr/local/apache/php/php.ini


I added the below entries into /usr/local/apache/conf/httpd.conf

# Use for PHP 5.x:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script php

# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php

AddType text/html php

# PHP Syntax Coloring
# (optional but useful for reading PHP source for debugging):
AddType application/x-httpd-php-source phps


Now when I try to execute below
sudo /usr/local/apache/bin/apachectl start

I get the following error ::
httpd: Syntax error on line 53 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: undefined symbol: php_escape_html_entities
Any help greatly appreciated