LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-06-2004, 01:08 PM   #1
vikram_cvk
Member
 
Registered: Jan 2004
Location: Hyderabad , India
Distribution: RHL 9
Posts: 42

Rep: Reputation: 15
problems configuring php and apache


Hello All,

Unable to run php files on Linux . php-4.2.2 is preinstalled on RHL 9 .Whenever I run a .php file in the webbrowser(Mozilla) the HTML source code of the file is being displayed instead of the output .

I did all the elementary diagnosis stated in the FAQ's like ....

1) $php -i (enter)

This command results in pagefule of HTML code (This indicates php is working properly).

2)Inserted the following in httpd.conf file ....

AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php .php

3)php4 module "libphp4.so" is seen under /etc/httpd/modules

4)$apachectl configtest (enter)
syntax ok (output)


According to the installation_FAQ(php website) if "$php -i" results in loads of HTML code & if HTML source is displayed when the ".php" is run in the webbrowser then it indicates that php is working properly and the problem lies with the webserver configuration .

There is one thing which is bit confusing ...... according to install manual "php.ini" file should be placed under /usr/local/lib ,but i found the file under /etc .

According to FAQ if file is under different location (other than default location ) then following line has to be added ..

--with-config-file-scan-dir=PATH

But even after adding the line there is no change !


Is the problem with the Apache Webserver or php . Where can I find php configuration file & can I make changes to it once it is installed . I could not find any php directory where such config file could be found .



contents of /var/log/httpd/error_log
------------------------------------
[Sat Mar 06 06:47:25 2004] [notice] Digest: generating secret for digest authentication ...
[Sat Mar 06 06:47:25 2004] [notice] Digest: done
[Sat Mar 06 06:47:26 2004] [notice] Apache/2.0.40 (Red Hat Linux) configured -- resuming normal operations
[Sat Mar 06 07:55:05 2004] [error] [client 202.223.68.1] Directory index forbidden by rule: /var/www/html/



Sorry for such a lengthy query ........ its just an effort to give a complete picture .

Plz help me out ..I'm posting this after going through the available FAQ's on the net .


Thx in advance .

Regards
Vikram.
 
Old 03-06-2004, 03:30 PM   #2
Qzukk
Member
 
Registered: Jun 2003
Posts: 132

Rep: Reputation: 15
Are you using the php module or the php CGI? If you're using the php CGI, you need to specify it as the handler for .php files in apache's config. If you're using the module, make sure apache's config has a LoadModule line to load the php4 module. Make sure that your scripts end in .php

Also make sure you've got the right configs. I don't know exactly what happened, but over the years, the RH server at work ended up with two completely different apache confgs and 3 php.ini files, of which only one of each did anything, and everyone was too scared to erase the extra configuration files.
 
Old 03-06-2004, 03:42 PM   #3
vikram_cvk
Member
 
Registered: Jan 2004
Location: Hyderabad , India
Distribution: RHL 9
Posts: 42

Original Poster
Rep: Reputation: 15
im using php module ,php module is already loaded and when i added LoadModule line "$apachectl configtest" said "php module already loaded skipping the line ........." then i commented that line in httpd.conf file
 
  


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
configuring php for apache PennyroyalFrog Linux - Newbie 3 02-08-2008 12:58 AM
configuring apache, php mjl3434 Linux - Software 4 09-22-2005 07:49 PM
Configuring PHP with Apache. LinuxStart Linux - Software 6 07-11-2005 10:15 AM
Configuring php on apache Dakkar Linux - Software 5 06-01-2004 10:26 AM
Problems configuring apache with php filezbyme Linux - Software 1 04-29-2002 11:43 PM


All times are GMT -5. The time now is 06:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration