PhpStorm

Created Monday 07 July 2014

php.ini:
[XDebug]
zend_extension_ts="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.remote_connect_back=1
xdebug.remote_log=/usr/lib/php5/xdebug.log
xdebug.max_nesting_level=500

Generate links:
http://www.jetbrains.com/phpstorm/marklets/

Set path:
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then

# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/phpstorm/bin" ] ; then

PATH="$HOME/phpstorm/bin:$PATH"
fi

Configure for using with CakePHP
http://www.jacoballred.com/web-dev/configuring-phpstorm-for-use-with-cakephp/

Configure xdebug for CLI:
http://stackoverflow.com/questions/1947395/how-can-i-debug-a-php-cli-script-with-xdebug
Copy [xdebug] section from apache2/php.ini to cli/php.ini
http://www.jetbrains.com/phpstorm/webhelp/run-debug-configuration-php-script.html
Configure PHP Script as instructed

Install Xdebug on Centos 5
http://programming-review.com/installing-xdebug-on-centos/
Here are exact steps to follow:

  1. You need to install PHP’s devel package for PHP commands execution
yum install php-devel
Make sure you also have php-paer package installed
yum install php-pear

  1. Next install GCC and GCC C++ compilers to compile Xdebug extension yourself.
yum install gcc gcc-c++ autoconf automake

  1. Compile Xdebug
pecl install Xdebug

  1. Find the php.ini file using
locate php.ini

And add the following line

[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_enable = 1

  1. Restart Apache
service httpd restart

  1. Test if it works – create test.php with the following code

<?php phpinfo() ?>
and check if you have the following output

Not a valid package...
http://askubuntu.com/questions/457242/download-of-pecl-xdebug-succeeded-but-it-is-not-a-valid-package-archive
sudo pecl install -Z xdebug

This helps:
http://stackoverflow.com/questions/14438503/configuration-of-xdebug-on-centos-with-php-5-2-8
http://xdebug.org/wizard.php

Remote debugging
http://blog.jetbrains.com/phpstorm/2014/04/php-remote-interpreters-support-in-phpstorm-8-eap/

Increasing inotify watches
http://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
sudo vim /etc/sysctl.conf
Add line:
fs.inotify.max_user_watches = 524288
sudo sysctl -p



Backlinks: