Forum Moderators: coopster

Message Too Old, No Replies

Including files via .htaccess

.htaccess php_value include_path

         

gllanci

1:47 pm on Aug 17, 2005 (gmt 0)

10+ Year Member



Hi,

I've downloaded an scritp that must include files throught .htacces..
If I upload the .htaccess file it apears 500 Internal Server Error...

Can somebody help me please?

Thanx in your adavance!
Gllanci

coopster

8:47 pm on Aug 17, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, gllanci.

It may be that your host is not allowing you to override PHP configuration directives in .htaccess files. Check that first. If they do, then we'll have to see an example of what you are using in your .htaccess file for directive overrides.

gllanci

2:01 pm on Aug 18, 2005 (gmt 0)

10+ Year Member



.haccess = file look so:
------------------------------------------
php_value include_path '.:/home/dimens/public_html/newpro/:
/home/dimens/public_html/newpro/library/
:/home/dimens/public_html/newpro/include/'
------------------------------------------

I think that my server support .htaccess but I have to edit my php.ini to add this lines (paths) but I cant edit that in my server cuz I dont have access!
Is there any way that I can edit my php.ini with php (ini_set) or what is the best way to make my script work!

Thnx a lot!
Gllanci

coopster

8:01 pm on Aug 18, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



This particular directive is of type PHP_INI_ALL, which means the entry can be set anywhere, including per-directory override files (.htaccess). The problem is either in your syntax [httpd.apache.org], which in this case should be OK as long as that string you show there is all on one line, not broken. If this is not the case, fix it and try again.

If you still receive the 500 error then your host is not allowing PHP directive overrides. Yes, they may still allow other overrides, but they are blocking any PHP-specific configuration directives. Yes, it is quite possible and there are many shared hosting providers that do so.

You may also set the include path in your script(s) if the .htaccess method isn't allowed because as stated before, this particular directive is of type PHP_INI_ALL. You can find more information on this directive and other ways to set it in the manual pages [php.net].