Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-28-2006, 01:49 PM   #1
Registered: Jan 2004
Distribution: Slackware, Ubuntu
Posts: 97

Rep: Reputation: 15
Apache doesn't execute PHP files?

I've just set up a Slackware 10.2 box to run as a webserver. I'm trying to run the following script:

// Show all information, defaults to INFO_ALL

// Show just the module information.
// phpinfo(8) yields identical results.

Apache doesn't execute the PHP code, instead it simply displays the code as a normal text file. mod_php appears to be installed properly (how can I tell if mod_php is installed properly?) here is /etc/apache/mod_php.conf:
# mod_php - PHP Hypertext Preprocessor module

# Load the PHP module:
LoadModule php4_module libexec/apache/

# Tell Apache to feed all *.php files through the PHP module:
AddType application/x-httpd-php .php

# This will display PHP files in colored syntax form.  Use with caution.
#AddType application/x-httpd-php-source .phps
and of course mod_php.conf contains this line that pulls in mod_php.conf:
#Include /etc/apache/mod_php.conf
This is pretty much a default slackware install (all packages). any idea what I'm doing wrong?

thanks in advance,
Old 01-28-2006, 01:53 PM   #2
Registered: Jan 2004
Distribution: Slackware, Ubuntu
Posts: 97

Original Poster
Rep: Reputation: 15
oops. looks like the Include part was commented out.
Old 01-28-2006, 02:29 PM   #3
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
Glad you found the problem It may also be useful to add index.php to your list of possible index files in httpd.conf if you'll be running a PHP based site:

DirectoryIndex index.html index.html.var index.php


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
Apache 2, PHP 5, SuSE 9.2 - cannot run php files dickohead Linux - Networking 6 06-28-2006 10:25 AM
php files errors on apache - sometimes amimusa Debian 1 04-07-2005 12:52 PM
Cant Get Apache to execute php pages nevarlen Linux - Newbie 1 02-17-2005 11:48 PM
running apache/php files limp Programming 3 11-07-2004 08:10 PM
Need help to configure Apache TO EXECUTE PHP SCRIPTS mgrapr Linux - Hardware 2 01-21-2004 09:23 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:37 AM.

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