PHP not parsing http://www.domain.com/
I have LAMP setup running on Slackware 13.1 for development purposes. If I go to hxxp://localhost/site/index.php the page is processed, but if I go to hxxp://localhost/site/ the php code is shown as plain text. I tried messing with the following directive:
<FilesMatch "\.php$"> SetHandler application/x-httpd-php </FilesMatch> I have searched and searched but I don't really know what to search for. Any guidance in the right direction would be greatly appreciated. |
Hi and welcome to LQ
Add index.php in the DirectoryIndex directive and reload apache Regards |
Hi and thanks for replying.
I have the DirectoryIndex directive set as: DirectoryIndex index.php index.html index.htm I know this directive is working since it auto loads index.php when going to hxxp://localhost/site/. At that point PHP is not parsing the file, but I know the PHP module is running since it loads when I explicitly point the browser to index.php. It definitely has something to do with the filename "index.php" not being included in the URL, but I admittedly do not know enough about LAMP setup to know what is causing this problem. Thanks. |
Are you sure it's not the browser cache that does this?
Clear it (on firefox click the refresh button while pressing the Shift key), or try with another browser and see if it works. |
Do you have .htaccess file in hxxp://localhost/ or hxxp://localhost/site/ directories? Post it if yes. And post your Apache configuration httpd.conf file. But first try
Code:
AddHandler application/x-httpd-php .php |
Okay I got it. It was cached, I thought I did a hard refresh but I guess I didn't. The problem came from me changing my hosts file in the middle of setting up. I appreciate everyone's help. It's always good to get fresh ideas from others when one gets frustrated. Thanks again.
|
All times are GMT -5. The time now is 09:23 PM. |