I'm just trying to set up the .htaccess file to point towards my 'include' directory. I'm working on my local server at the moment (localhost) and don't know the syntax for stating the path on localhost. Here's the contents of my .htaccess file:
php_value include_path ".:localhost/web/website/directory/includes"
The above path is where my include file is on my server but it doesn't show up when I try to access it. Can anyone tell me what's wrong with the above? Does it make a difference if I'm using IIS and have a php.ini file?
slip
php include path
Moderator: General Moderators
Re: php include path
Yes, IIS does not honor .htaccess files. Thats an apache-specific technique for the most part. (A few other webservers support it, but not IIS).slippyaah wrote:I'm just trying to set up the .htaccess file to point towards my 'include' directory. I'm working on my local server at the moment (localhost) and don't know the syntax for stating the path on localhost. Here's the contents of my .htaccess file:
php_value include_path ".:localhost/web/website/directory/includes"
The above path is where my include file is on my server but it doesn't show up when I try to access it. Can anyone tell me what's wrong with the above? Does it make a difference if I'm using IIS and have a php.ini file?
slip
basically it is for this particular site only. I have a directory like this:
localhost/web/site/sitefolder/
where site is the site I'm working on and sitefolder is the folder with the following 2 folders in:
1) includes
2) public_html
inside public_html I have all of my site contents (including the .htaccess file). e.g.:
images
templates
users
index.php
login.php
.htaccess
etc etc
so I just need to specify a path to the includes directory WITHOUT specifying it for all other web sites which is what making changes to the php.ini file in windows will probably do....?
any thoughts?
slip
localhost/web/site/sitefolder/
where site is the site I'm working on and sitefolder is the folder with the following 2 folders in:
1) includes
2) public_html
inside public_html I have all of my site contents (including the .htaccess file). e.g.:
images
templates
users
index.php
login.php
.htaccess
etc etc
so I just need to specify a path to the includes directory WITHOUT specifying it for all other web sites which is what making changes to the php.ini file in windows will probably do....?
any thoughts?
slip
If you don't have access to php.ini just specify the path when you use include() or require(). In your case:
Code: Select all
include('../includes/filename.ext');