LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 10-24-2006, 06:54 AM   #1
hoiatl
LQ Newbie
 
Registered: Oct 2006
Posts: 1

Rep: Reputation: 0
Question HELP! Apache2 and php pages


I know very little about php pages, however I have set up several servers. Right now I have a apache2 server working just fine, using the standard htm html pages. However now the html person has decided they want to write the web page with php. I have already edited the httpd.conf file DirectoryIndex line but the server still will not serve up .php pages. All browsers want to download the page. How do I set it up to stop serve php pages?
 
Old 10-24-2006, 07:21 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Edit httpd.conf.

In the Dynamic Shared Object (DSO) Support section, add
Code:
LoadModule php5_module        modules/libphp5.so
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
Find the following, add the php entries:
Code:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents.  The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.html.var index.php index.phps
This assumes that you've read the installation instructions for PHP (that tells you how to compile Apache 2 for use with PHP and that you've compiled PHP as per those instructions); just adding the above may not work if Apache was not compiled with the options spelled out in the PHP installation instructions.

Finally, after you've stopped and restarted httpd, you may have to clear your browser's cache before
Code:
<?php
        phpinfo();
?>
will display anything (when you do get a display from phpinfo, you're good to go).
 
  


Reply



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
Apache2.0.52, t1lib-5.0.2, php-apache2-5.0.2 wizard7423 Slackware 2 04-04-2011 08:09 PM
Apache2 not processing PHP4 pages on Debian Sarge blue penguin Linux - Software 8 08-24-2006 02:56 PM
Suse 9.3/apache2/php4 - Firefox tries to download index.php, other *php pages work stefanlasiewski SUSE / openSUSE 1 01-18-2006 06:12 PM
Apache2: remove details on error pages hamish Linux - Networking 2 07-20-2005 09:54 AM
My Apache2 fails to parse php-scripts in html pages 3-1415 Linux - Software 6 10-21-2004 05:59 AM

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

All times are GMT -5. The time now is 12:28 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