Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'

I have seen a few post with a similar issue: Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'
I have followed up on advice and ideas from them all and still I cannot get phpstorm to overcome this error.
I am using the zero settings debug button: "Start Listen for PHP Debug Connections"
I have my environment set per instructions at

From the above link:
How to run script using this solution (for Xdebug):

export XDEBUG_CONFIG="idekey=session_name"
export PHP_IDE_CONFIG="serverName=server_name"


When I run this command which is to use drupal's helper command line php program..
$ drush cr

..phpstorm responds with a pop up message:
Cannot accept external Xdebug connection
Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'

I made many changes to 3 php.ini files, restarted apache and tried to get things to work but still phpstorm logs the same error.
Here are settings in /etc/php5/cli/php.ini:

zend_extension = /usr/lib/php5/20121212/
xdebug.extended_info = 1
xdebug.idekey = "PHPSTORM"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_mode = "req"
xdebug.remote_port = 9000

Settings in /etc/php5/cgi/php.ini, /etc/php5/apache2/php.ini are similar.

What can be done? Should I file a bug report?
1 comment
Comment actions Permalink

I found the solution. drush can use its own php.ini file and I had forgotten that I did create one: /home/randy/.drush/php.ini
I added the xdebug settings to that file and phpstorm debugger works. However, the pop up
message still pops up! No big deal though. I am very glad I can debug with phpstorm :)


Please sign in to leave a comment.