Jump to content

Include error


takn25

Recommended Posts

Hi, I am trying to upload my PHP file in a directory on the sub domain called "pro" the error I am getting is

 

I have used <?php include ("/pro/error_function.php"); ?>

 

 

 

Warning: include(/pro/error_function.php) [function.include]: failed to open stream: No such file or directory in

 

and

 

 

Warning: include() [function.include]: Failed opening '/pro/error_function.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php')

 

could some one help me what is the problem?

Link to comment
https://forums.phpfreaks.com/topic/231231-include-error/
Share on other sites

A leading slash / on a file path refers to the root of the current hard disk.

 

You would either use an absolute file path ($_SERVER['DOCUMENT_ROOT'] will get the base path to your document root folder) or you would use a file path relative to the current script (a file path starting with a ./ or a ../) or you would let php search the include_path setting to find the file (when neither an absolute or relative file path is given.)

 

All of this information can be found in the php.net document for the include() statement.

Link to comment
https://forums.phpfreaks.com/topic/231231-include-error/#findComment-1190114
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.