0
votes

Suddenly, this website stop working and this errors appeared:

Warning: include_once(///controllers/site/default.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/html/sitename.com/web/index.php on line 54

Warning: include_once() [function.include]: Failed opening '///controllers/site/default.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/sitename.com/web/index.php on line 54

I don't know how CakePHP works, this is why I need help to figure out what happened (without anyone messing the code). The indicated files, that says that they're not there (No such file or directory), are exactly where the path describes.

I appreciate any help!

Error from line 54 in index.php:

include_once sprintf('%s/%s%s/%s.php', ROOT_PROJECT, CONTROLLERS_DIR, $url->tipo, 'default');
1
What's the code generating the issue? (index.php line 54)Fyntasia
Sorry, I forgot to quote that. Just edited de code.Anna
///controllers/site/default.php is wrong path. Your problem maybe happens because of %ses are blank?user1261322
What CakePHP version is this?Oldskool
Yes, I think that this is where the problem relies... But I still can't figure this out. When I type for www.sitename.com/web/index.php, the errors changes. There are no include errors, but it's weird how this website was working perfectly once. The server root is also weird, 'cause there are only folders: web, tmp, logs and data.Anna

1 Answers

0
votes

I believe the problem lies in the variables inserted through sprintf.

There are some empty ones causing a lot of backslashes to be added to the string;

Basically it says

include('///controllers/site/default.php');

(This is also visible in the generated php warning)

Try catching empty variables or parsing the resulting string (making sure only 1 backslash exists between every parameter).

If I'm right the next php command should work:

include('/controllers/site/default.php');

Hope this helps.