Jump to content

Configuring Apache with php


toms

Recommended Posts

Hello,

 

I am running Slackware Linux 12 with an Apache server.  I had Apache and php installed with it(off the cd).  However, when I try to access php files in my browser, the html/php text is displayed.  I have agthered that this is becuase Apache is not comfigured to run php, but i have been unnable to find comprehensible help on the internet.  I am hoping someone can tell how to configure Apache to run php.  Thank you.

Link to comment
Share on other sites

You'll want to make sure your httpd.conf file contains the lines....

 

LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
<IfModule mod_php5.c>
  AddType application/x-httpd-php .php .phtml .php3
  AddType application/x-httpd-php-source .phps
</IfModule>

 

or similar then restart Apache.

Link to comment
Share on other sites

Thanks a lot.  I can now run a "Hello World" php from the server.

 

By the way, if anyone has the same problem, the folder was /usr/lib/httpd/modules/libphp5.so rather than /usr/lib/apache2/modules/lib5.so.

 

Thanks again; I was getting pretty frustrated trying to find information on the internet.

Link to comment
Share on other sites

By the way, if anyone has the same problem, the folder was /usr/lib/httpd/modules/libphp5.so rather than /usr/lib/apache2/modules/lib5.so.

 

Yeah, this can be distro specific, mine was taken from my Debian Etch server.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.