LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   PHP not parsing http://www.domain.com/ (https://www.linuxquestions.org/questions/linux-server-73/php-not-parsing-http-www-domain-com-855984/)

gold4t 01-12-2011 09:56 PM

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.

bathory 01-13-2011 12:09 AM

Hi and welcome to LQ

Add index.php in the DirectoryIndex directive and reload apache

Regards

gold4t 01-13-2011 06:20 AM

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.

bathory 01-13-2011 06:49 AM

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.

eSelix 01-13-2011 07:11 AM

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
without FilesMatch directives.

gold4t 01-13-2011 08:56 PM

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.