LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-12-2011, 09:56 PM   #1
gold4t
LQ Newbie
 
Registered: Jan 2011
Posts: 3

Rep: Reputation: 0
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.

Last edited by gold4t; 01-12-2011 at 09:57 PM.
 
Old 01-13-2011, 12:09 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Hi and welcome to LQ

Add index.php in the DirectoryIndex directive and reload apache

Regards
 
Old 01-13-2011, 06:20 AM   #3
gold4t
LQ Newbie
 
Registered: Jan 2011
Posts: 3

Original Poster
Rep: Reputation: 0
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.

Last edited by gold4t; 01-13-2011 at 06:26 AM.
 
Old 01-13-2011, 06:49 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
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.
 
Old 01-13-2011, 07:11 AM   #5
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
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.

Last edited by eSelix; 01-13-2011 at 07:17 AM.
 
Old 01-13-2011, 08:56 PM   #6
gold4t
LQ Newbie
 
Registered: Jan 2011
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DNS http:domain.com resolve to www.domain.com keysorsoze Linux - Networking 3 02-12-2007 03:03 AM
LXer: http://www.clusterresources.com/pages/press/press-releases.php LXer Syndicated Linux News 0 04-12-2006 07:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration