LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache 1.3 + PHP5 ISSUE (http://www.linuxquestions.org/questions/linux-software-2/apache-1-3-php5-issue-676115/)

marguelles 10-13-2008 04:15 PM

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.

bathory 10-14-2008 09:13 AM

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

marguelles 10-14-2008 11:17 AM

Hello Bathory, thank you for your quickly answer.

Quote:

Originally Posted by bathory (Post 3309735)
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.

bathory 10-14-2008 04:18 PM

Try to move the LoadModule and AddModule directives for php at the end of the corresponding list, since the modules order is important.

marguelles 10-14-2008 04:59 PM

Solved
 
Quote:

Originally Posted by bathory (Post 3310118)
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 :)


All times are GMT -5. The time now is 08:02 AM.