LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-04-2007, 10:43 AM   #1
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Rep: Reputation: 39
Adding PHP capability to Apache


Hi there --

I have a Red Hat Enterprise Linux 3 system running Apache 1.3.33, and have received a request to activate php on the server. Currently, any php page that is brought up shows only the raw code.

The system does have php 4.3.4 and php 5.0.4 installed, but when I do an http -l command, I notice that mod.so is not one of the modules listed, and the httpd.conf file does not contain any reference to php.

How can I activate php on the server without the risk of overwriting any of the current configuration settings? Thanks.
 
Old 01-05-2007, 03:21 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by kaplan71
Hi there --

I have a Red Hat Enterprise Linux 3 system running Apache 1.3.33, and have received a request to activate php on the server. Currently, any php page that is brought up shows only the raw code.

The system does have php 4.3.4 and php 5.0.4 installed, but when I do an http -l command, I notice that mod.so is not one of the modules listed, and the httpd.conf file does not contain any reference to php.

How can I activate php on the server without the risk of overwriting any of the current configuration settings? Thanks.
Hi

Not sure about your setup, but when I install Apache to have PHP capability I do the following.

1. Compile Apache with the following configure line:

./configure --enable-so --enable-mods-shared=/usr/local/apache2/modules/libphp5.so

2. Compile and configure PHP:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-apache2 --with-config-file-path=/usr/local/lib

3. Add these to httpd.conf in apache directory apache2/conf

LoadModule php5_module /usr/local/apache2/modules/libphp5.so

AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

So maybe, if you have the PHP module present already (or you got it from an RPM or something) all you might need to do is add

LoadModule php5_module /usr/local/apache2/modules/libphp5.so

to your httpd.conf and do

apache2/bin/apachectl restart

...
 
  


Reply


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
PHP & Apache - php files not processing aolong Linux - General 1 12-17-2006 03:09 AM
Adding users with PHP (pass php variables to Expect script) Jayla Programming 1 10-20-2006 10:44 AM
Apache 2, PHP 5, SuSE 9.2 - cannot run php files dickohead Linux - Networking 6 06-28-2006 10:25 AM
Apache/PHP Question on adding modules dynamically nyheat Linux - Software 3 03-15-2006 12:08 AM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM

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

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