Hi, I just started to play with the php.ini and the auto_prepend_file functionality. If I have a subdomain which is located in the following sample path on the server /public_html/subdomain and in that subdomain I got a php.ini file which automatically ads a header, Is it possible to do it for all files even in subfolders of that domain. The file that I want to prepend is currently in the public_html folder. my current php.ini file looks like this auto_prepend_file = "../top.inc" Code (markup): thanks for any advice.
Use the full path to the file instead of a relative path. If I understand your situation right PHP should be attempting to prepend the file everywhere already, it's just that when it tries while in other subdirectories the relative path is translating to the parent directory instead of the grandparent directory.
Yeah tried that as well but as soon as I go into the subfolder of the subdomain it wont work. It always just works on the root folder of that subdomain.
I guess it can't be the path, auto_prepend_file functions like require() meaning you'ld get a fatal error if it wasn't finding the file. I'm not familiar with per-directory php.ini files, however since auto_prepend_file is a PHPINI_PER_DIR confiruration you should be able to override it in htaccess and Apache would propagate it into the subdirectories. php_value auto_prepend_file "/public_html/top.inc" Code (markup): That is unless you're running PHP as CGI instead of an Apache Module.