Latest blog entry

Ubuntu: PHP libphp5.so missing: cannot open shared object file

February 27, 2012    |   Posted by admin   |    Category: Linux Administration

If Apache2 service fails to start with a “libphp5.so: cannot open shared object file” message, it indicates that libphp5.so is missing on your Ubuntu server.

Apache2 has detected a syntax error in your configuration files:
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

Apache configuration calls the php5.load file which includes the path to the libphp5.so module. The php5.load cannot load libphp5.so file if it is missing from the /usr/lib/apache2/modules/ directory. See if it exists:

# ls -la /usr/lib/apache2/modules/libphp5.so
 ls: cannot access /usr/lib/apache2/modules/libphp5.so:
 No such file or directory

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
Comments Off on Ubuntu: PHP libphp5.so missing: cannot open shared object file

Unzip: skipping filename.zip need PK compat. v4.5

February 20, 2012    |   Posted by admin   |    Category: Linux Administration

Sometimes extracting a zip file using the unzip command may result in the “skipping: filename.zip  need PK compat. v4.5” error message.

# unzip filename.zip
Archive:  filename.zip
   skipping: filename.zip  need PK compat. v4.5 (can do v2.1)

This is due to the file been compressed with the latest version of PKZIP which the unzip command cannot handle. The solution is to install p7zip package which can handle the files compressed using PKZIP.

Download the latest version of p7zip:

# wget http://sourceforge.net/projects/p7zip/files/p7zip/\
9.20.1/p7zip_9.20.1_x86_linux_bin.tar.bz2

Extract the file

# tar -jxf p7zip_9.20.1_x86_linux_bin.tar.bz2

goto the extracted directory and run the installer

# ./install.sh

This will install the ‘7za’ command on your server using which the zip file can be extracted

# 7za x filename.zip
 Processing archive: filename.zip
 Extracting  filename
 Everything is Ok
Comments Off on Unzip: skipping filename.zip need PK compat. v4.5