How to install mod_php5 on SuSE 11.1?

Installing apache2, php5 and mod_php5 shouldn't be too hard, but it took me nearly 2 hours trying to get this installed on SuSE v11.1. The later SuSE 11.4 works just fine by installing the required modules with zypper, but the SuSE 11.1 wouldn't work right out of the box.

Here are the steps required to get the mod_php5 to work on SuSE 11.1. The v11.1 installs php5-5.2.6 where v11.4 installs php5-5.3.5. We had to downgrade the php due to package dependency issues.

1. Add official OpenSuSE repository

# zypper ar http://download.opensuse.org/distribution/11.1/repo/oss/ OSS

2. Install apache2, php5, mysql and apache2-mod_php5

# zypper install apache2 php5 mysql apache2-mod_php5

3. The 64-bit version of apache2-mod_php5 module adds the following files.

/etc/apache2/conf.d/php5.conf
/etc/php5/apache2
/etc/php5/apache2/php.ini
/usr/lib64/apache2/mod_php5.so

4. Edit the following files to let the apache2 know of mod_php5.

# Edit /etc/sysconfig/apache2 and add "php5" in the APACHE_MODULES list.
# Edit /etc/apache2/sysconfig.d/loadmodule.con, and add a "LoadModule" entry for mod_php5.
LoadModule php5_module /usr/lib64/apache2-prefork/mod_php5.so
# Make a symbolic link in the /usr/lib64/apache2-prefork/ folder.
(cd /etc/lib64/apache2-prefork; ln -s ../apache2/mod_php5.so)
# Edit /etc/apache2/httpd.conf, and add "Include" directive as below:
Include /etc/apache2/conf.d/php5.conf

5. Restart apache2.

# service apache2 restart

Comments

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.