Link to home
Start Free TrialLog in
Avatar of kgiit
kgiit

asked on

PHP script error Warning: include_once...: failed to open stream:

I have a friend that moved from one host to another, and basically just copied their directories over without regard to structure.  I'm not saavy with the PHP/MYSQL/CPanel stuff, but I can tell the problem is that the scripts are pointing in the wrong direction:

Warning: include_once(include/core.php) [function.include-once]: failed to open stream: No such file or directory in /home/sandiega/public_html/register.php  on line 2

Warning: include_once() [function.include]: Failed opening 'include/core.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/sandiega/public_html/register.php on line 2

Warning: include_once(include/db.php) [function.include-once]: failed to open stream: No such file or directory in /home/sandiega/public_html/register.php on line 3

Warning: include_once() [function.include]: Failed opening 'include/db.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/sandiega/public_html/register.php on line 3

I don't have admin access to the new host server, just the Cpanel admin console.  Is their a way to fix this via the Cpanel?  Or, do the scripts need to be recoded?  I don't think the host has tech support with this type of knowledge, as my friend has not been able to get this corrected with them, and he doesn't know what PHP platform he was on before (if that makes a difference).
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

You need to make sure that the public_html folder has a subfolder called 'include' and that the core.php is inside that.

If it still doesn't work, you may need to add the following line at the start of your script.

set_include_path('/include');


Avatar of kgiit
kgiit

ASKER


Chris,

The script has the '/include' path in it, but there is no include folder anywhere in the directory tree.  I don't know if it was overwritten, deleted, or whether the server admin has to open the path to it.  He may not have copied all of the files that he needed, just those he thought were relevant to the site itself.  Which is what I'm afraid is the problem.

thanks for your reply.
open your cpanel a click on file manager look for your include folder.
If its not there it was not transfered
Avatar of kgiit

ASKER


Hi tdot,

I went through all of the directories, did a search with the CPanel, and didn't find /includes or the missing files.  He doesn't have access to the old host files anymore.  Is there a way to replace?  Or, is it a recoding fix?

thanks
ASKER CERTIFIED SOLUTION
Avatar of tdot
tdot

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi, kgiit

There is nothing more we can do can you please close the question..
Avatar of kgiit

ASKER


Question answered.