Jump to content

Recommended Posts

Hi peoples,

 

I have bought myself a brand new toy: a synology disk station 107+.

Very cool!

 

This comes with a webserver and I'm trying to set up some scripts on it.

Unfortunately it will not work as I would expect it to: my php includes generate error messages.

Eg., the following code 

 require('/fpdf/fpdf.php');

will generate the error

Failed opening required '/fpdf/fpdf.php' (include_path='.:/usr/syno/php/lib/php') in /volume1/web/script.php

 

The file is located in a subdirectory of where my script.php file is located, but apparently the server is configured to look for it in the usr/syno/lib/php directory.

How can I configure my server so that the include paths will be relative to the file that asks for the include?

 

After googling for this I think it has probably to do with my php.ini settings, but I'm not sure what I should change.

Maybe there is an easier way to adapt the script so that it will always work, no matter how the server is configured?

If your error_reporting was set to E_ALL (which it should be when learning php, developing php code, or debugging php code) you would have also gotten the following error -

 

Warning: require(/fpdf/fpdf.php) [function.require]: failed to open stream: No such file  or directory in ..... your_file.on line x

 

A leading slash on a file system path refers to the root of the current hard disk. I'm going to guess that your don't have a folder named fpdf in the root of your hard disk with that file in it. You need to either form an absolute file system path to where the file is actually at or form a relative file system path from where the main script is at or set up the include_path so that it contains an entry for where that file is at.

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

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