Apache / PHP4 not serving .php files

Apache / PHP4 not serving .php files

Post by Gerald Jense » Wed, 27 Sep 2000 04:00:00



I just upgraded my server (running Apache 1.3.12) to PHP4.0.2 ... now only
files with the extension .php3 are served. Files with extensions .php and
.php4 return 'HTTP 404 - File not found'?!?

I compiled PHP as a DSO, using the options --with-mysql --with-apxs

The following directives are present in httpd.conf:

# Extra Modules
LoadModule php4_module         modules/libphp4.so

# Extra Modules
AddModule mod_php4.c

# In Addtype - Mime Types
<IfModule mod_php4.c>
  AddType application/x-httpd-php .php .php3 .php4
  AddType application/x-httpd-php-source .phps
</IfModule>

 
 
 

Apache / PHP4 not serving .php files

Post by Joshua Sliv » Wed, 27 Sep 2000 04:00:00



> I just upgraded my server (running Apache 1.3.12) to PHP4.0.2 ... now only
> files with the extension .php3 are served. Files with extensions .php and
> .php4 return 'HTTP 404 - File not found'?!?

What does the error log say?

--
Joshua Slive

http://finance.commerce.ubc.ca/~slive/

 
 
 

Apache / PHP4 not serving .php files

Post by Gerald Jense » Wed, 27 Sep 2000 04:00:00


Aaarrrggghhh! Too much sleep, not enough coffee and junk food. I forgot this
is a multihomed server with a bunch of Virtual Hosts. I was hitting one of
the IP addresses and expecting to get files in the document root. The one
file (phpinfo.php3) that was being served was in one of the Virtual Host doc
roots, so I kept seeing it instead of the files I thought I was hitting.

You were right, Joshua ... the answer was in the error log!



> > I just upgraded my server (running Apache 1.3.12) to PHP4.0.2 ... now
only
> > files with the extension .php3 are served. Files with extensions .php
and
> > .php4 return 'HTTP 404 - File not found'?!?

> What does the error log say?

> --
> Joshua Slive

> http://finance.commerce.ubc.ca/~slive/

 
 
 

1. RHL7.0 and PHP4: Apache config file problem: file extensions

The /etc/httpd/conf/httpd.conf file that comes with RHL7.0 contains the
following lines (see below). This is pointless as Red Hat 7.0 does not
install PHP/FI which is now outdated and does not install PHP3 either
but does install PHP4 which is broken up into the packages php-ldap,
mod_php, php, php-imap, php-mysql, php-pgsql, and php-manual. Hence
the PHP/FI and perhaps also the PHP3 lines should have been commented
out by the RPM spec file as I can now use .php3 extensions but not
.php or .php4 extensions for files to be correctly interpreted by the
Apache web server and I am not root on the system hence I cannot change
this. Has this problem been fixed in Red Hat 7.1?

Thanks!

# The following is for PHP4 (conficts with PHP/FI, below):
<IfModule mod_php4.c>
  AddType application/x-httpd-php .php4 .php3 .phtml .php
  AddType application/x-httpd-php-source .phps
</IfModule>

# The following is for PHP3:
<IfModule mod_php3.c>
  AddType application/x-httpd-php3 .php3
  AddType application/x-httpd-php3-source .phps
</IfModule>

# The following is for PHP/FI (PHP2):
<IfModule mod_php.c>
  AddType application/x-httpd-php .phtml
</IfModule>

2. I can't setup CGI's

3. Problem with Apache + PHP4 DSO : symbol __muldi3: referenced symbol not found

4. script/command to automate untarring

5. Apache/PHP4: shared object not found

6. ST-01/2 SCSI drive support

7. PHP4 instructions do not work in HTML files

8. Nvidia User couldnt install X server

9. mod_put, PHP, Apache says "file not found" with .phtml files

10. Apache serves only PHP?

11. Apache w/ PHP and SSL: w/ PHP OK - w/out PHP NOK

12. apache not serving binary files?

13. Apache served binaries files not recognised by browser as binary, but displayed