|
|
 |
Re: FN-FORUM: Updating php.ini through .htaccess
date posted 15th November 2007 11:15
Hi
You can use ini_set in your
script(http://uk3.php.net/manual/en/function.ini-set.php)
ini_set('include_path', '/path/to/your/libs')
Another way is to set a env variable which will be added to the server
environment (http://uk3.php.net/manual/en/function.putenv.php)
putenv('LIB_DIR=/path/to/your/libs')
you can retrieve it with getenv('LIB_DIR')
or you can define a constant like
define('LIB_DIR', '/path/to/your/libs')
and then use it as
require_once LIB_DIR . '/your_script.php';
Hope it makes sense
Alex Townsend wrote:
> All,
>
> I'm using a hosted server where I don't have access to php.ini .
> I'm wondering if there's a way to add a folder to the include path via
> .htaccess or similar?
>
> Basically, I have a folder for include files, and I'd rather be
> able to generically use "/includes/xyz.php" throughout the site,
> rather than having to use relative links if possible.
>
> Any advice on this one will be gratefully received!
>
> TIA
>
> Alex
> www.ozbon.com
>
>
>
>
>
|
 |
|