A Bit of Slack Never Hurt Anyone

LAMP on Slackware (Part 2)

Prev.. This is Part 2 of "How to configure Apache, MySQL and PHP on your Slackware machine." ..Next

Apache and PHP

Configure httpd to work with php files

Now that you know your server is functioning correctly, lets get PHP working!
Open up your /etc/httpd/httpd.conf file once again and find the following section:<IfModule dir_module> DirectoryIndex index.html <:/IfModule>and make it look like this<IfModule dir_module> DirectoryIndex index.php index.html index.htm <:/IfModule>Next move down and uncomment (remove the #) from the mod_php.conf Include line like this:Include /etc/httpd/mod_php.confSave the file and restart the httpd server/etc/rc.d/rc.httpd restart

Testing PHP

To test that php is functioning correctly we should create a quick test page. Change directory to the one specified in DocumentRootcd /var/www/htdocsCreate a new file called index.php and add the following code:<?php phpinfo(); ?>and save it.

Open up your web browser and point it to "http://localhost/index.php" and you should see the output from phpinfo().
Note: phpinfo() gives detailed information about your php setup so best not leave this open to the Internet.

This article is continued in LAMP on Slackware Part 3