Re: attemping to set up a LAMP server

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Alex Dean
Date:  
To: Main PLUG discussion list
Subject: Re: attemping to set up a LAMP server
eric© wrote:
> 3.)apachectl restart doesn't work, I've been using /etc/init.d/apache2
> restart

On Debian it's 'apache2ctl'. /etc/init.d/apache2 works for stopping and
starting. For the very handy 'configtest' option, you still need
apache2ctl.

>
> [Wed Jan 24 03:26:02 2007] [warn] module php5_module is already
> loaded, skipping[Wed Jan 24 03:26:02 2007] [notice] mod_python:
> Creating 8 session mutexes based on 150 max processes and 0 max threads.

I think that somewhere you have redundant 'LoadModule' directives for
php5_module. One of them is in /etc/apache2/mods-available/php5.load.
The other is bogus, and should be removed. Do a grep in your apache
config files to find it.

Note : Trying to load the module twice won't really hurt anything, but
for sanity's sake it's still better to remove it.

> Everything appears to be configured correctly, but attemping to open
> any php file within Firefox (on the server itself) just asks if I want
> to open it and with what app or if I want to save it. Opening the
> file in Nautilus opens the file as a text file.

That probably means that Apache isn't sending the right MIME-type, and
is defaulting to 'binary' or something. Your browser thinks it can't
display the content, so it offers to let you save it somewhere. Try
saving the file, and then opening it with a text-editor. Do you see PHP
source code, or the output of the source code? That will tell you
whether the PHP module is actually operating on your code or not.

I think this can be fixed by making sure that you have an 'AddType'
directive for .php. There's one provided by
/etc/apache2/mods-available/php5.conf.

Are you sure the correct configuration files are enabled? What is the
output of this command : 'ls -l /etc/apache2/mods-enabled/ | grep php'

/etc/apache2/mods-enabled/php5.conf should be a symlink to
/etc/apache2/mods-available/php5.conf
/etc/apache2/mods-enabled/php5.load should be a symlink to
/etc/apache2/mods-available/php5.load

The contents of the files in /etc/apache2/mods-available should be :
::::::::::::::
php5.conf
::::::::::::::
<IfModule mod_php5.c>
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
</IfModule>

::::::::::::::
php5.load
::::::::::::::
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so

Also, check that mod_mime is enabled. Check that
/etc/apache2/mods-enabled/mime.load exists. It almost certainly is, or
you'd get 'unknown directive' warnings every time your config files used
AddType, but it's worth verifying.
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss