LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Help Setting Up PHP On Apache (https://www.linuxquestions.org/questions/linux-networking-3/help-setting-up-php-on-apache-198559/)

AFI_Flame 06-28-2004 01:54 AM

Help Setting Up PHP On Apache
 
I just installed a fresh Slackware 10.0 and I got Apache working but it doesn't seem to want to work with PHP. I thought Slackware came with PHP already installed so I just put this sample test file in htdocs.

Code:

<p>This page was created at <b>
<?php echo date("h:i:s a", time()); ?>
</b> on the computer running PHP.</p>

I named it timetest.php and when I load http://localhost/timetest.php it just gives me back the code insted of showing the time like it's supposed to. I'm kinda half way following the turorial on Dreamweaver on my Windows partition and that's where I got that code from.

vbraca 06-28-2004 07:27 AM

Edit your httpd.conf file (Apache configuration) and add following lines:

AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
DirectoryIndex index.php
DirectoryIndex index.php3
DirectoryIndex index.php4

ShawnRisk 06-28-2004 07:31 AM

Here is the way to install PHP and other with Apache http://www.start-linux.com/articles/article_79.php When the code comes back that means that you don't have PHP setup on the computer..

AFI_Flame 06-28-2004 12:44 PM

ah ok i got it working now... i had to uncomment this line in my httpd.conf file

Code:

Include /etc/apache/mod_php.conf


All times are GMT -5. The time now is 08:36 PM.