LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Apache 2, PHP 5, SuSE 9.2 - cannot run php files (http://www.linuxquestions.org/questions/linux-networking-3/apache-2-php-5-suse-9-2-cannot-run-php-files-295361/)

dickohead 02-27-2005 12:10 AM

Apache 2, PHP 5, SuSE 9.2 - cannot run php files
 
Hey guys,

I had everything running in mandrake 10.1, and have now upgraded to SuSE 9.2, along with the changes of /etc/apache2 and /srv/www i cannot seem to get either of the following working:

users public_html directories - can't find what i am supposed to add to /etc/apache2/httpd.conf

and

php5 - nothing, nada, zip. Not a thing works, it asks me (when running locally) if i want to save the file or open it with a program.... i don't want either, i want it to display my web page! :p

I have the LoadModule section in httpd.cong being imported, i also have the directory index file set to:
index.php index.html index.htm

the reason for that is cos the main site will run php, but users home dirs will run html/php - so i needed both :p

has anyone here, successfully got Apache 2 and PHP 5 working on SuSE 9.2 (the download one, not professional) i do have a copy of 8.2 pro which i bought a couple of years back... but am seeing if 9.2 can do what i want first - so far - php is all it won't do.... :D 90% aint bad! but that 10% is making me lose sleep.... :( :

i hope what i have done wrong is very simple.... and hopefully you will make me look stupid! at least then i'll remember next time! :D

xowl 02-27-2005 12:30 AM

to fix the php problem add the line

Include /etc/apache/mod_php.conf

to the /etc/apache/httpd.conf

dickohead 02-27-2005 01:29 AM

i don't have the /etc/apache/mod_php.conf file though..... which strikes me as very strange, i have installed the rpms for mod-php and php5 in SuSE and via SSH at the command line.... so thye are there.... but mod_php.conf is not...

dickohead 02-27-2005 01:37 AM

i just made a file called mod_php.conf under /etc/apache2 and upun executing "/etc/init.d/apache2 restart" it informas me that "module php5_module is already loaded"

here is my mod_php.conf file:
Code:

#
# mod_php - PHP Hypertext Preprocessor module
#

# Load the PHP module:
LoadModule php5_module libexec/apache/libphp5.so

# Tell Apache to feed all *.php files through the PHP module:
AddType application/x-httpd-php .php

# This will display PHP files in colored syntax form.  Use with caution.
#AddType application/x-httpd-php-source .phps

and my httpd.conf file:
Code:

### Virtual server configuration ############################################
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
Include /etc/apache2/vhosts.d/*.conf


# Note: instead of adding your own configuration here, consider
#      adding it in your own file (/etc/apache2/httpd.conf.local)
#      putting its name into APACHE_CONF_INCLUDE_FILES in
#      /etc/sysconfig/apache2 -- this will make system updates
#      easier :)
Include /etc/apache2/mod_php.conf
"httpd.conf" 209L, 8227C                                      209,21        Bot
# and never show them
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

# List of resources to look for when the client requests a directory
DirectoryIndex index.php index.html index.htm

### 'Main' server configuration #############################################
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
Include /etc/apache2/default-server.conf


# Another way to include your own files
#
# The file below is generated from /etc/sysconfig/apache2,
# include arbitrary files as named in APACHE_CONF_INCLUDE_FILES and
# APACHE_CONF_INCLUDE_DIRS
Include /etc/apache2/sysconfig.d/include.conf


### Virtual server configuration ############################################
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
Include /etc/apache2/vhosts.d/*.conf


# Note: instead of adding your own configuration here, consider
#      adding it in your own file (/etc/apache2/httpd.conf.local)
#      putting its name into APACHE_CONF_INCLUDE_FILES in
#      /etc/sysconfig/apache2 -- this will make system updates
#      easier :)

if there appears to be nothing wrong, i shall try and reinstall apache along with all modules etc.

dickohead 02-28-2005 06:20 PM

i've also noticed that there is no http module in yast... would this be a problem?

imagineers7 06-27-2006 11:26 PM

Hi,

this is for those who may find this thread in future for answer:-


Read this documentation
http://in2.php.net/manual/en/install.unix.apache2.php
or
Read this thread
http://www.linuxquestions.org/questi...hreadid=103392


Hope, this will help someone

saavik 06-28-2006 10:25 AM

For suse you need to use /etc/sysconfig/apache2 (dont know the exact filename might be apache2.conf)

Add all modules here and than run SuSEconfig!!

Modules do not need to appear in yast (depending on the exact version)


All times are GMT -5. The time now is 11:42 PM.