Search code examples
phpcommand-linephpunitphp-extension

forbid PHP CLI to load an extension present in the ini config file


I have a php installation where i want to have several extensions loaded via ini files. both for apache and for command line.

but for a few unit tests, i do not want those extensions loaded.

can i call php or phpunit in a way that it will not load certain extensions?

let's say, my php.ini on the system is:

extension = A.so
extension = B.so
extension = C.so

i want to run php this time with A and B only. Is there some option like php --exclude-extension=C.so or php -d "extension=!C.so" that eluded me from the manual?


Solution

  • Not possible.

    there's no extension list exclusion in php.