Results 1 to 10 of 10
Aug 15, 2012, 10:56 #1
Pulling My Hair Out Trying To Get PHP includes to Work!
Firstly just want to say thanks in advance.
I've just started converting a more or less static site into a php driven site. I haven't previously
used php to any great length and I'm seriously having problems setting up includes. I'm working
on localhost at the moment.
My directory/project structure is as the following:
mysite.com/index.php mysite.com/includes/ mysite.com/category-1/demo.php mysite.com/category-2/ mysite.com/category-3/ ...etc
able to use that path on any page, in any directory.
I've currently got this in my htaccess file in the root directory:
php_value include_path "php"
<?php require_once("some-include.php"); ?>
<?php include_once("some-include.php"); ?>
get it to work I've had to create a separate .htaccess file for each directory and place the following:
php_value include_path "../php"
includes without having to use relative paths?
Any suggestions are greatly appreciated at this point.