|
Home > Archive > Apache Server configuration support > November 2006 > web page with php will only work if named .html rather than .php
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
web page with php will only work if named .html rather than .php
|
|
|
| Hi folks,
I am new to this web hosting lark. so forgive me if this is painfully
obvious.
A customer's website contains a lot of php, and most of the files have
the .php extension
Most of the site works fine (including index.php).
However, some links don't... they just hang as if the file can't be found.
I rename the link to look for file.html and rename the file to file.html
and it works fine....even the php stuff.
This is an old red hat linux with 2.25 kernel running apache 1.3 with
php3 php4 etc modules included.
My counter part says nothing can be done apart from renaming all the files.
Customer says this site works fine elsewhere.
I feel sure that this is a simple server misconfiguration somewhere but
I don't know where to look.
I've been through httpd.conf and the only odd thing I saw was that
mod_php4, mod_php3 and mod_php are all loaded despite the fact that php4
says it conflicts with the php/FI.
Any ideas?
--
Andy Richardson
Never criticize a man 'til you've walked a mile in his shoes.
After that, you can say what you like..
'cos you're a mile away and you've got his shoes.
| |
| Kenneth Svee 2006-11-30, 7:29 am |
| [ Andy ]
> Hi folks,
>
> I am new to this web hosting lark. so forgive me if this is
> painfully obvious.
>
> A customer's website contains a lot of php, and most of the files
> have the .php extension Most of the site works fine (including
> index.php). However, some links don't... they just hang as if the
> file can't be found.
>
> I rename the link to look for file.html and rename the file to
> file.html and it works fine....even the php stuff.
This sounds strange. Check the httpd.conf for type-definitions modfied
on a Directory/Location-basis, like
<Directory /var/html/foo/bar>
<IfModule mod_php4.c>
AddType application/x-httpd-php .php .php3 .php4
AddType application/x-httpd-php-source .phps
</IfModule>
</Directory>
or a similar SetHandler-directive (see docs[1] for more info) to see
if that can explain why some scripts work and others doesn't.
If the PHP-files works when renamed .html there should be at least one
AddHandler/SetHandler-direvtive or an
"AddType application/x-httpd-php .html"
present somewhere.
Also; if the PHP-scripts are written for different versions, you might
have the wrong module loaded (e.g. PHP3 when PHP4 should be loaded).
> This is an old red hat linux with 2.25 kernel running apache 1.3
> with php3 php4 etc modules included.
....
> I feel sure that this is a simple server misconfiguration somewhere
> but I don't know where to look. I've been through httpd.conf and the
> only odd thing I saw was that mod_php4, mod_php3 and mod_php are all
> loaded despite the fact that php4 says it conflicts with the php/FI.
This sounds wrong. One Apache can but load one PHP-module unless
someone has done a LOT of modifying. You might be confusing
config-directives? A server can have config-blocks for a PHP-module
thats not loaded.
In Apache v1.3 you need both a LoadModule- and an AddModule-directive
for each module that loaded (e.g. "LoadModule php4_module
libexec/libphp4.so"). Check your config for those, and you should not
see more than one active (a '#' in front means it's commented out and
not active).
[1] http://httpd.apache.org/docs/1.3/
Rgds,
Kenneth Svee
|
|
|
|
|