vampke Posted April 1, 2010 Share Posted April 1, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/197215-webserver-configuration-problem-php-includes-do-not-work/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 1, 2010 Share Posted April 1, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/197215-webserver-configuration-problem-php-includes-do-not-work/#findComment-1035241 Share on other sites More sharing options...
vampke Posted April 1, 2010 Author Share Posted April 1, 2010 I reacted too soon: the problem has not been solved... Quote Link to comment https://forums.phpfreaks.com/topic/197215-webserver-configuration-problem-php-includes-do-not-work/#findComment-1035294 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.