0

I am using the php config auto-append-file to append code that i need to be executed on all pages on a particular domain.

But my problem is that there are other domains that share the same php.ini file so i wanted to know if there is a way to specify that for a particular domain.

I have tried setting the config with ini_set() but the change was not made and phpinfo() confirmed that this failed.

I also tried doing that via php_value inside a .htaccess file but that returned a 505 internal server error and i have no clue why.

Any thoughts on how i could accomplish this ?

Thanks in advance

PS: I mainly want to append the file on all domains hosted, except one. So what i thought is set it via php.ini and then reset it for the domain where i don't want that since it will be a lot faster.

2 Answers 2

2

If you are using a loader other than an Apache DSO, then you cannot use .htaccess PHP directives as the server does not understand them, thus the 500 error. For most loaders (CGI, SuPHP, etc.) you are allowed to use a per-directory php.ini (or .user.ini in newer PHP versions). You can override any PHP setting inside of this file, including the value for auto-append-file.

2
  • i see, i am running a CGI loader.. and so an ini file in lets say the root of the folder of a domain would apply to all subfolders right? Aug 14, 2012 at 4:39
  • Actually a php.ini file only applies to the directory in which it is contained.
    – Garrett
    Aug 14, 2012 at 5:47
0

It would appear that .htaccess is on the right path. I found this article explaining how to do what you are looking for with RewriteRule. Link is here .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .