How do I specify the php.ini file?

I added my PHP directory to the PHP Home: setting (c:\PHP), but it's using the php.ini file in that directory. On our development machines, we specify using PHPRC that the php.ini file should be c:\PHP\devrc\php.ini. How do I specify that?

5 comments

Hello Keith,

Do you mean your include paths are taken from php.ini? PhpStorm doesn't directly read php.ini, instead it executes a small script that contains

ini_get('include_path')

call to get the paths. Script is run in console via php.exe located in the folder that you provide as PHP Home.

Regards,
Kirill

0

I don't understand. I changed my php.ini file and it updated the include paths.

0

Hello Keith,

Do you mean you've changed c:\php.ini include paths and PhpStorm picked them up on the next 'Update include paths' invocation?
Please ensure that PHPRC variable is properly set for the PhpStorm process, since the script process that reads include paths inherits all the variables from the parent process that is PhpStorm.

Regards,
Kirill

0

I'm not sure what you mean. The PHPRC is set as an environment variable. Is there somewhere to set it for PHPStorm?

0

Nope, there's no specifal setting in PhpStorm, it is expected to be set by operating system.

What output will you get if you open console at c:\php, put the test.php file with the following content:

<?php
echo htmlspecialchars(ini_get('include_path'));
?>

and execute then

php test.php

?

0

Please sign in to leave a comment.