Page 1 of 1

require_once errors

Posted: Fri Jul 03, 2009 9:55 am
by deanaldo
Having some trouble understanding this error my browser produces when I run a website locally:
PHP Warning: require_once(includes/joomla.php) [function.require-once]: failed to open stream: No such file or directory in C:\Websites\Webpage1\public_html\lifestyle\index.php on line 26 PHP Fatal error: require_once() [function.require]: Failed opening required 'includes/joomla.php' (include_path='.;C:\php5\pear') in C:\Websites\Webpage1\public_html\lifestyle\index.php on line 26 PHP Warning: require_once(includes/joomla.php) [function.require-once]: failed to open stream: No such file or directory in C:\Websites\Webpage1\public_html\lifestyle\index.php on line 26 PHP Fatal error: require_once() [function.require]: Failed opening required 'includes/joomla.php' (include_path='.;C:\php5\pear') in C:\Websites\Webpage1\public_html\lifestyle\index.php on line 26
The joomla file is in the includes directory and here is a copy of what line 26 is in the index.php:

Code: Select all

require_once( 'includes/joomla.php' );
Any help would be appreciated, thanks

Re: require_once errors

Posted: Fri Jul 03, 2009 10:13 am
by Eric!
It looks like your path isn't right. Either specify the full path in the include or add the path to the file into your include list which is only '.' and 'c:/php5/pear' right now.

Code: Select all

$path = '/my/path/includes';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
You can also use the .htaccess to set the include path if you're running apache

Re: require_once errors

Posted: Mon Jul 06, 2009 5:49 am
by deanaldo
Just to note I am using IIS 7, I've fiddled around a bit and I'm now getting this error

Code: Select all

PHP Warning: require_once(/home/lifestyl/public_html/lifestyle/includes/version.php) [function.require-once]: failed to open stream: No such file or directory in C:\Websites\webpage1\public_html\lifestyle\includes\joomla.php on line 71 PHP Fatal error: require_once() [function.require]: Failed opening required '/home/lifestyl/public_html/lifestyle/includes/version.php' (include_path='.;C:\PHP\pear') in C:\Websites\webpage1\public_html\lifestyle\includes\joomla.php on line 71
Here is the code on line 71 in joomla.php

Code: Select all

require_once( $mosConfig_absolute_path . '/includes/version.php' );
The version file is in the includes folder so I'm guessing there is some path issue, any ideas?

Re: require_once errors

Posted: Wed Jul 15, 2009 6:09 am
by deanaldo
Still stuck with this :x Anybody able to help? Much appreciated thanks

Re: require_once errors

Posted: Wed Jul 15, 2009 6:42 am
by turbolemon
Does C:\Websites\Webpage1\public_html\lifestyle\includes\joomla.php exist? Also, you may need to replace the require path:

Code: Select all

require_once( 'includes/joomla.php' );
to

Code: Select all

define( 'DS', DIRECTORY_SEPARATOR ); //only if it's not already defined!
 
require_once( 'includes'.DS.'joomla.php' );
Seems you are using Joomla 1.0, any reason for not upgrading to 1.5? They cut official support for 1.0 in 7 days.

Check the configuration.php file to see if there are any hard-coded paths (if it has one, i did very little development in 1.0).