Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want a single specific vhost in my Apache configuration to override auto_prepend PHP configuration directive and always include a PHP file, without other sites including it.

One option is to use SetEnv in Apache and getenv in PHP with auto_prepend set in php.ini

share|improve this question

migrated from stackoverflow.com Oct 20 '12 at 1:11

This question came from our site for professional and enthusiast programmers.

    
depending on your config. u should be able to put a php.ini file in your vhost directory? –  j_mcnally Oct 19 '12 at 16:48

1 Answer 1

up vote 1 down vote accepted

Untested, but I'd try adding

php_value auto_prepend_file /your/path/here.php

to your vhost config. According to the PHP docs, this method only works if PHP is run as an Apache module.

share|improve this answer
    
Accepted because it just worked! Thanks –  djechelon Oct 19 '12 at 18:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.