LAMP on Slackware (Part 2)
Apache and PHP
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.conf
Save 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/htdocs
Create 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.