LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to get PHP and Apache to work (https://www.linuxquestions.org/questions/linux-software-2/how-to-get-php-and-apache-to-work-804356/)

MTK358 04-26-2010 03:34 PM

How to get PHP and Apache to work
 
I wanted to play around with PHP and already have Apache installed, but instead of showing the intended page I just see the PHP source code, despite having tried many of the guides online.

tronayne 04-26-2010 04:00 PM

You do need to edit your httpd.conf file.

You'll need to add index.php like this
Code:

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

And you'll need to
Code:

# Uncomment the following line to enable PHP:
#
Include /etc/httpd/mod_php.conf

The Include directive may or may not already be in your httpd.conf file -- if so, just uncomment it; otherwise insert a line similar to the above near the end of your httpd.conf (depending upon where your mod_php.conf file actually is).

Then, stop and restart httpd and give 'er a shot. Also, you may need to "force" page reload in your browser (or clear the cache).

Hope this helps some.

ninohead 04-27-2010 08:18 AM

Hi
This might help you
http://linux.nsguru.com/your-first-f...n-suse-t20.htm


___________________________________-
I shot an arrow in the sky and its stuck

MTK358 04-28-2010 10:19 AM

@tronayne

That worked!


All times are GMT -5. The time now is 12:06 AM.