Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fatal error: main() ...

Status
Not open for further replies.

Maig

Technical User
Nov 14, 2003
32
CA
I have this site that I've been trying to move from one server to another. The site was built in Joomla and the database is on a Windows Server using MySQL. I have managed to transfer the database over to the new server and I have done the edits to the config file for the joomla part. This should mean that the site is up but when I type in the URL I am getting this error message:

Fatal error: main(): Failed opening required '/.../includes/compat.php50x.php'
in '/.../includes/joomla.php on line 60

So I know very little about PHP but I went to the includes/joomla.php file and went to line 60 and this is the code that is there:

if (version_compare( phpversion(), '5.0' ) < 0) {
require_once( dirname( __FILE__ ) . '/compat.php50x.php' );
}

Well, that is the code that is one lines 59 and 60 in the joomla.php file.

I haven't got a clue what this all means but I'm expected to get the site up and running if possible.

Any help would be appreciated.
Thanks,
Maig.
 
require_once( dirname([red] __FILE__[/red] ) . '/compat.php50x.php' );:
__FILE__ is a so-called magic constant. It will always expand to the current filesystem (not relative to the document root, but on the entire system filesystem) path and filename of the current script. See
require_once( [red]dirname([/red] __FILE__ [red])[/red] . '/compat.php50x.php' );:
dirname(), when given a file path and filename of a file, returns just the directory. If __FILE__ is '/home/sites/ dirname(__FILE__) will be '/home/sites/ See
require_once( dirname( __FILE__ ) [red].[/red] '/compat.php50x.php' );:
The "." operator performs concatenation. With the dirname() invocation as its lefthand operand and the string as its righthand operand, it looks like the concatenation will produce a full path and filename of another file that's supposed to be in the same file as this script. See
[red]require_once([/red] dirname( __FILE__ ) . '/compat.php50x.php' [red])[/red];:
require() includes another file in this one. It will produce an error and cause the script to die() if it cannot find the file in question (as you have seen). require_once() will not actually perform the inclusion a second time within the run of any single script. See


It looks to me like the script is expecting to find in the directory where it resides another script named "compat.php50x.php", but that the file is missing.



Want the best answers? Ask the best questions! TANSTAAFL!
 
I looked and that file is there in the same directory as the joomla.php file.

Maig.
 
What are the permissions on the file?

Since a PHP script running under a web server will run with the permissions of the user as which the web server runs, does your web server's user have permission to read the file?



Want the best answers? Ask the best questions! TANSTAAFL!
 
I'm not sure how to check that, I only have access to the remote server through Dreamweaver at this point. If I right click on the file and choose "Set Permissions" and set read and execute for User/Groups it gives me an error that says "Setting access properties failed for: (the file)

I am guessing I would have to FTP in to the server to see/set permissions?

Thanks,
Maig
 
Also, I checked the permissions on the local side and they are set to read and execute for Users/Groups but I'm not sure that would be the same on the remote site.

Maig
 
I just checked again and I'm still getting the same error but I missed part of the error...

Fatal error: main(): Failed opening required '/.../includes/compat.php50x.php' (include_path='.:/usr/local/lib/php') in /.../includes/joomla.php on line 60
 
This is weird, on my local site I have one INCLUDES folder but on the remote site there are two, one in all caps and one in lowercase. The one in lowercase does NOT have the compat.php50x.php file in it...

Maig
 
There's your problem.

Judging by your path statements, you're probably on a filesystem with case-sensitive filenames. So a directory named "INCLUDE" is different from a directory named "include".



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top