Including a PHP file that can be used with multiple sites
- by Roland
I have a web server that we use, apache, centos5, php
I have a file called 'include.php' that I need to include in multiple sites.
Eg. I have a site called testsite.co.za, now in the index.php i want to include the include.php file, the include.php is not in the root of testsite.co.za,
Now i created another folder includes in the web root directory which contains include.php
my code looks as follows in testsite.co.za/index.php
require_once '../includes/include.php';
if i run testsite.co.za it can't detect include.php. Is there a certain server setting I need to change in order to include this file?
My directory structureof
-/var/www/html
-testsite.co.za
-index.php
-includes
-include.php
Hope this makes sence