0

Today I updated PHP 5.2 to 5.3 but then Apache Startup doesn't work.

Apache says:

Starting web server: apache2apache2: Syntax error on line 205 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load: Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: cannot open shared object file: No such file or directory

Cannot load /usr/lib/apache2/modules/libphp5.so

Is downgrading PHP 5.3 to PHP 5.2 a good idea? If so, how can I do it?

1 Answer 1

1

See if the libphp5.so module is installed elsewhere on the server using the find and locate command

# find / -name libphp5.so
# locate libphp5.so

if it is, copy it to /usr/lib/apache2/modules/ directory and restart Apache. If the file is not present, install the ‘libapache2-mod-php5′ package, the PHP5 module for Apache2. It adds the required FilesMatch directives to the Apache configuration.

# apt-get install libapache2-mod-php5

The ‘libapache2-mod-php5′ package will create the libphp5.so file under the modules directory and apache2 will restart successfully

# /etc/init.d/apache2 restart

if you want to go with downgrade:

Remove PHP

sudo apt-get remove php5-common
sudo apt-get remove php5-cli
sudo apt-get remove php5
sudo apt-get autoremove memcached

Update your sources list to point to PHP 5.2

sudo nano /etc/apt/sources.list

Remove the references to PHP 5.3 packages. For me that was:

deb http://php53.dotdeb.org stable all
deb-src http://php53.dotdeb.org stable all

Add the following 5.2 packages:

deb http://http.us.debian.org/debian stable all
deb http://security.debian.org/ stable/updates main contrib
deb http://packages.dotdeb.org/ stable all

Install PHP 5.2

sudo apt-get update
sudo apt-get install php5-cli
sudo apt-get install php5

Reinstall any PHP modules your application requires. For me that was:

sudo apt-get install memcached
sudo apt-get install php5-memcache
sudo apt-get install php5-curl
sudo apt-get install php5-mysql
sudo reboot

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .