Americas

  • United States

Adding PHP to an Apache 2 Web server

Opinion
Apr 12, 20042 mins
ApacheEnterprise ApplicationsPHP

* Dr. Internet columnist Steve Blass offers advice on how to add PHP to an Apache 2 Web server

Our Linux server (running IBM’s Apache 2-based HTTP server) is having trouble installing PHP support so we can try the PHP-Nuke content management software as a customer service portal. We can’t get Apache to load the PHP module by following the PHP instructions. Any suggestions?

The PHP Install file directs Apache 2 users to documentation (https://www.php.net/manual/en/install.apache2.php) where instructions for enabling the PHP4 module suggest adding a ‘LoadModule php4_module libexec/libphp4.so’ line to your Apache httpd.conf file.

Change ‘libexec’ to ‘modules’ and make sure there is a copy of libphp4.so in the Apache server’s modules directory.

Installing PHP from source code on your Linux server will ensure that all PHP components are in the right place. Then add an ‘AddType application/x-httpd-php.php’ line to Apache’s httpd.conf file before restarting the Web server.

You can test your installation with a test.php file containing this: .

When installing PHP-Nuke (https://phpnuke.org/), you might need to adjust the SQL installation script ‘nuke.sql’ and edit the config.php file.

To edit the PHP-Nuke home page once it is running, create and log on to the admin account. Then view the home page, and you will see the ‘Edit’ link at the bottom.