| Author |
how to set include_path in PHP?
|
|
| Allen Guan 2004-12-30, 8:55 pm |
| My hosting provider does not allow me to modify /etc/php.ini. So I can opt
to use function ini_set("include_path",....) to set include_path. But this
seems to work only on script level. Is there a better way to set
include_path globally. I mean any php script under DocumentRoot can see it.
Thanks a bunch!
Allen Guan
| |
| Chris Hope 2004-12-30, 8:55 pm |
| Allen Guan wrote:
> My hosting provider does not allow me to modify /etc/php.ini. So I can
> opt to use function ini_set("include_path",....) to set include_path.
> But this seems to work only on script level. Is there a better way to
> set include_path globally. I mean any php script under DocumentRoot
> can see it.
Create an .htaccess file with the following, assuming your host allows
you to have .htaccess files:
php_value include_path ./:/path/to/1:/path/to/2:/path/to/3
--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
| |
| Allen Guan 2004-12-31, 3:56 am |
| "Chris Hope" <blackhole@electrictoolbox.com> wrote in message
news:1104450389_78381@216.128.74.129...
> Allen Guan wrote:
>
>
> Create an .htaccess file with the following, assuming your host allows
> you to have .htaccess files:
>
> php_value include_path ./:/path/to/1:/path/to/2:/path/to/3
>
> --
> Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Thanks. I put this php_value in my local httpd.conf and it works fine. But
when put it in the .htaccess file on the hosting site under documentroot, I
got 500 error. If I leave .htaccess empty, no problem. So my hosting provide
allows .htaccess but I don't know why I got 500 error.
Allen
| |
| Chris Hope 2004-12-31, 3:56 am |
| Allen Guan wrote:
> "Chris Hope" <blackhole@electrictoolbox.com> wrote in message
> news:1104450389_78381@216.128.74.129...
>
> Thanks. I put this php_value in my local httpd.conf and it works fine.
> But
> when put it in the .htaccess file on the hosting site under
> documentroot, I got 500 error. If I leave .htaccess empty, no problem.
> So my hosting provide allows .htaccess but I don't know why I got 500
> error.
When I tried it out earlier on today I was just trying in the httpd.conf
so I thought I'd better try it now with .htaccess and it also worked.
I'm using apache 1.3.31 and PHP 4.3.10 - what versions is your host
using? You may need to check with your host to see what the problem is.
--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
|
|
|
|