Re: Can't find .php3 files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jim wrote:
Chris wrote:

I'm trying to help a friend migrate his application to php 5 from another system. The problem seems to be that he references files (require, include, etc) that have a .php3 extension, however there are no files in those locations with the .php3. There are files with .php extensions. It's running on a system that has php 4 on it.

If you can ssh in to the server, go to the base folder of the app and:

grep -nri 'php3' *

and make sure there are no references in the code to php3 files.

Else try the same in windows search or using your editor, see if it has a 'find in files' type option.

So I'm sure either php or Apache is rewriting the files somehow, but I don't know how.

Check for a .htaccess file.

See if apache is set up to handle php3 files, look for something like this in the config:

AddType application/x-httpd-php .php3


If this is causing a fatal error, your logs should also tell you where to start looking. The apache2 error logs are pretty good, eg:

[date] [error] [client ipaddr] PHP Warning: include(../includes/db.php): failed to open stream: No such file or directory in /path/to/file.php

I think you misunderstood.  I have lots of file with things like

require "admin.php3"

But there is no admin.php3 anywhere.  There is however a file admin.php.
Since this works on the old server then something on that system is translating a request for a .php3 file to .php I'm guessing. Apache or php but I don't know which.

The old server is a Linux system, while the new one is a bsd system (OS X).

Both systems have the
AddType application/x-httpd-php .php3
Line in their configuration.
Thanks,
Jim.


if you can ssh to the linux box, I would do a "locate admin.php3" from the prompt.

If there is an admin.php3 file on your system, it should be shown here.

Another thing to look at is the PHP include path. Get all the directories that are listed and check all those locations. It will have to be in one of those locations, if not, it isn't being used.

Another thing to make sure of is that you are not hiding any errors that might otherwise tell you that they files that are being called to by the require/include statements are missing or otherwise unreadable.

Put this at the top of your script:

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);

# rest of your code follows

?>

This will show you all errors, if any, on that page.  Maybe the error is being quietly tossed out.

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux