Welcome Guest, Not a member yet? Register   Sign In
Question with error on Exceptions.php
#1

[eluser]Ben Edmunds[/eluser]
Hey guys,

I have a question. I am moving a locally developed project over to my staging server and am getting this message:
Code:
Warning: require(./system/libraries/Exceptions.php) [function.require]: failed to open stream: No such file or directory in /media/disk/websites/usability/httpdocs/system/codeigniter/Common.php on line 127

Fatal error: require() [function.require]: Failed opening required './system/libraries/Exceptions.php' (include_path='.:/usr/share/php:/usr/share/pear') in /media/disk/websites/usability/httpdocs/system/codeigniter/Common.php on line 127

I am using CodeIgniter 1.7.2 and am running PHP 5.3.0 locally and PHP 5.2.4 on the staging server.


If I ignore the error by throwing an @ in front of line 127 in Common.php everything seems to work fine.


Thanks,
#2

[eluser]Ben Edmunds[/eluser]
bump - This site is moving to production soon...
#3

[eluser]wabu[/eluser]
Well you probably checked already but is everything located and configured the same, such as the value of $system_folder in the root index.php?
#4

[eluser]BrianDHall[/eluser]
A couple of things don't make since to me here. For one, CI is looking for a system file in the wrong place - in fact, a place that makes no sense at all.

It is looking for ./system/libraries/Exceptions.php relative to /media/disk/websites/usability/httpdocs/system/codeigniter/Common.php - if it was looking for ../system that would work, but of course there is no system/codeigniter/system folder.

The other thing is perhaps this is just an IDE issue, but my line 127 is "if ($is_subclass == TRUE)", not a call to require.

Putting that aside, the problem seems to be that either your APPPATH or BASEPATH is simply wrong, you are likely just missing a dot. This is defined in index.php, so along with wabu this is likely where the problem is.

Remember, ./ means "same directory as this file", ../ "start at one level above this directory".

If that isn't it then I can only conclude you over-rode some core function that is causing this problem.
#5

[eluser]Ben Edmunds[/eluser]
Thanks for the replies.

In my root index.php $system_path is "./index.php".

I haven't changed anything in the CI core. Also, if the system path was off I would have problems with more than just one file.


One more thing to note is that for this project I am developing local on windows and staging in linux. Not that that should make a difference but it can affect paths.

So... any other ideas?
#6

[eluser]steelaz[/eluser]
Perhaps Windows are having problem with relative paths. Try setting absolute path for your system and application folders in root index.php

Code:
$system_folder = '/media/disk/websites/usability/httpdocs/system';

Code:
$application_folder = '/media/disk/websites/usability/httpdocs/system/application';

or (depending on your directory structure):

Code:
$application_folder = '/media/disk/websites/usability/httpdocs/application';
#7

[eluser]Ben Edmunds[/eluser]
Thanks for the suggestion but everything is working fine in windows. The linux server is where I'm having problems, plus I don't want to hack on my index.php file as I shouldn't have to.


Any other ideas guys?


Thanks,
#8

[eluser]steelaz[/eluser]
Did you at least try to see if it fixes the problem?

It's not really hacking, changing system folder path is part of CI setup when you want to keep your application files behind public root directory. It is documented in user guide.
#9

[eluser]Ben Edmunds[/eluser]
But that's not what I'm doing. The system folder is inside the public folder. I'm using a standard CI directory structure.

I can try it, it just doesn't make sense that everything else would work fine except exceptions.php if the paths were off.




Theme © iAndrew 2016 - Forum software by © MyBB