Search code examples
phpphpstorm

Specify php.ini in phpStorm


I've set-up my PHP environment with the $PHPRC environment variable to point to the php.ini. Since $PHPRC is set during bash start-up, it's never set for phpStorm. This means phpStorm is using the wrong php.ini for CLI. This is especially anoying since I do a lot of PHPUnit testing.

How can I make phpStorm using the same php.ini? I'd prefer to have a possibility to specifiy the php.ini somehow in phpStorm, but I cannot find such an option.

In case this matters, I'm on OSX using MAMP PRO 2.1.


Solution

  • You could do it like this:

    1.: Create your run configuration for the test

    2.: Add your php.ini path to your command line/interpreter options