LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 10-13-2008, 04:15 PM   #1
marguelles
LQ Newbie
 
Registered: Sep 2008
Location: Argentina
Distribution: At home Debian 5.04 64bit // At work RHEL 5.4 - SLES 10
Posts: 9

Rep: Reputation: 0
Thumbs up Apache 1.3 + PHP5 ISSUE - SOLVED


Hello everybody, I just followed the steps given in "LampHowTo" web page and everything seems to be fine before I try to see a PHP file on my new Apache web server.

Apache 1.3 does not process PHP files. I already added the few magic lines in the httpd.conf file that tells Apache to process ".php" and "phps" files with the PHP module, but when I browse for a php page, I.E...
Code:
localhost/index.php
Firefox tries to download the file


What do you suppose that is happening with Apache? I think that it is not recognizing the PHP module.

Thanks in advance.

Last edited by marguelles; 10-14-2008 at 07:34 PM. Reason: SOLVED
 
Old 10-14-2008, 09:13 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,937

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
Quote:
I already added the few magic lines in the httpd.conf file that tells Apache to process ".php" and "phps" files with the PHP module
Most likely you forgot the line that loads the php5 module:
Code:
LoadModule php5_module        modules/libphp5.so
 
Old 10-14-2008, 11:17 AM   #3
marguelles
LQ Newbie
 
Registered: Sep 2008
Location: Argentina
Distribution: At home Debian 5.04 64bit // At work RHEL 5.4 - SLES 10
Posts: 9

Original Poster
Rep: Reputation: 0
Hello Bathory, thank you for your quickly answer.

Quote:
Originally Posted by bathory View Post
Most likely you forgot the line that loads the php5 module:
Code:
LoadModule php5_module        modules/libphp5.so
No I didn't forgot this file. Here is my httpd.conf file:
k
Code:
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file http://httpd.apache.org/docs/dso.html for more
# details about the DSO mechanism and run `httpd -l' for the list of already
# built-in (statically linked and thus always available) modules in your httpd
# binary.
#
# Note: The order in which modules are loaded is important.  Don't change
# the order below without expert advice.
#
# Example:
# LoadModule foo_module libexec/mod_foo.so
LoadModule php5_module        libexec/libphp5.so
LoadModule env_module         libexec/mod_env.so
LoadModule config_log_module  libexec/mod_log_config.so
LoadModule mime_module        libexec/mod_mime.so
LoadModule negotiation_module libexec/mod_negotiation.so
LoadModule status_module      libexec/mod_status.so
LoadModule includes_module    libexec/mod_include.so
LoadModule autoindex_module   libexec/mod_autoindex.so
LoadModule dir_module         libexec/mod_dir.so
LoadModule cgi_module         libexec/mod_cgi.so
LoadModule asis_module        libexec/mod_asis.so
LoadModule imap_module        libexec/mod_imap.so
LoadModule action_module      libexec/mod_actions.so
LoadModule userdir_module     libexec/mod_userdir.so
LoadModule alias_module       libexec/mod_alias.so
LoadModule rewrite_module     libexec/mod_rewrite.so
LoadModule access_module      libexec/mod_access.so
LoadModule auth_module        libexec/mod_auth.so
LoadModule setenvif_module    libexec/mod_setenvif.so

#  Reconstruction of the complete module list from all available modules
#  (static and shared ones) to achieve correct module execution order.
#  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
AddModule mod_php5.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_so.c
AddModule mod_setenvif.c

#
And, at the end of the file:

Code:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
I don't know if I added this line in the wrong tag.
 
Old 10-14-2008, 04:18 PM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,937

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
Try to move the LoadModule and AddModule directives for php at the end of the corresponding list, since the modules order is important.
 
1 members found this post helpful.
Old 10-14-2008, 04:59 PM   #5
marguelles
LQ Newbie
 
Registered: Sep 2008
Location: Argentina
Distribution: At home Debian 5.04 64bit // At work RHEL 5.4 - SLES 10
Posts: 9

Original Poster
Rep: Reputation: 0
Smile Solved

Quote:
Originally Posted by bathory View Post
Try to move the LoadModule and AddModule directives for php at the end of the corresponding list, since the modules order is important.
Thank you very much Bathory! It's working now
 
  


Reply

Tags
apache, lamp, php


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
apache 2 with php5 and mysql5 jghalo Linux - Software 1 09-08-2006 03:22 PM
Apache2, PHP5, MySQL and charset issue lenanu Linux - Software 2 06-26-2006 04:30 AM
apache + php5 + mysql dejan_su Debian 2 05-23-2006 01:55 PM
configure php5 and mysql issue jiawj Programming 1 08-17-2005 03:34 PM
Apache and PHP5 Mogatu Linux - Software 3 06-17-2005 03:43 PM


All times are GMT -5. The time now is 12:22 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration