如何为同一个脚本使用多个php.ini文件

Basically, I need to override a critical value in php.ini. The behavior of the command line PHP is to use the first php.ini it detects and no others.

  1. I cannot change the 'global' php.ini because this value override is only for a certain set of scripts. I do not want to affect the behavior in general of php scripts on the system.
  2. it cannot be done using 'ini_set' because if a script has a parse error, the directive will not be set.
  3. When I try to declare some of my extensions, I get environment-specific issues of it trying to locate the libraries for those extensions. I do not know beforehand specifically where the extensions may be located.

Any ideas? Can command line php simply not use ini files in a cascading fashion?

Note, this is the value:

auto_prepend_file=...

My command line is as follows:

php -c path\to\main\ini;path\to\special\ini -f thescript.php

You can always override selected ini values with the -d switch:

php -c path\to\php.ini -d auto_prepend_file=C:\prepend.php -f thescript.php