httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blomstrom <>
Subject [users@httpd] include_path in .htaccess file
Date Sun, 15 Feb 2004 21:40:36 GMT
I installed Apache, MySQL and PHP a few weeks ago,
made one change to my Apache conf file and haven't
touched it since. I've just been working with MySQL
and PHP.

Today, I asked a question on a forum regarding PHP
includes. Below are some include links from my home
page (C:/sites/freedomware/index.php/) and the next
level (C:/sites/freedomware/world/index.php):

<?php include ("includes/top.php"); ?>
<?php include ("../includes/top.php"); ?>

I was trying to figure out a way to replace ../ with a
variable, so I could link every page to the same
include, whether the URL is preceded by ../ or

Someone told me I'm doing it the wrong way. They
suggested several other ways...

"After you've placed all your include files into one
directory, you can easily set the include_path in one
of three ways (providing you don't have access to the
php.ini file):

    * Via the ini_set() function.
    * In PHP > v4.3, the set_include_path() function.
    * With an .htaccess file

"Obviously if you have access to the php.ini file, you
can set it permanently there."

I haven't yet figured out how to do any of these.
Someone said the best way is to modify the php.ini
file, but modifying the .htaccess file is recommended
on a tutorial at

So I wondered if you recommend that route and, if so,
can you give me some pointers? I typed "include_path"
into the search function at and didn't get any
hits at all.

Here's how my projects are set up:

All my websites are in a folder named sites, and my
Apache, MySQL and PHP folders are in a folder named


I modified my httpd conf file so that when I type
http://localhost/ into a browser, it brings up

The site I'm working on right now is located at
C:/sites/freedomware/ and the includes are located in
a folder named includes:

One thing I wondered is if I have to make a separate
htaccess file for each of my websites. Also, do I have
to publish my modified htaccess files online?

Please let me know if you're aware of a good tutorial.


Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message