Jump to content

Include error


takn25
 Share

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
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
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.