php_value auto_prepend_file myconstants.php

OK, I can use php_value auto_prepend_file and .htaccess to assign "directory wide" CONSTANTS.

.htaccess is for apache so if my php files are out of the document_root, then the above solution and .htaccess won't work, right?

I have a directory of php files out of the document root and I used to run these files under the command line. I still want it is able to assign to assign "directory wide" CONSTANTS without have to include the costants file in each php file under that directory, how could I do it?

Thanks!

    Using .htaccess is only one way to alter PHP directives; if you're running PHP via the CLI, you could either:

    1. Use the "-c" option to specify your own php.ini file, or

    2. Use the "-d foo[=bar]" option to specify the desired auto_prepend_file value.

      Write a Reply...