- Php >= 5.4 is already installed.
- Java 7 or greater is installed.
- PhpStorm 6 is installed
- Download PhpStorm 6.0.3 from here
- Uzip the downloaded file.
- Navigate to
bin
directory and execute./phpstorm.sh
. (Give execute permission tophpstorm.sh
if it is not already there)
- Execute
php -i > php_info.txt
on terminal - Visit xdebug custom installation page & paste the content of
php_info.txt
(created in the above step) in the text box provided & follow the instructions. - Don’t do the last step as mentioned in the xdebug installation (Adding
zend_extension
inphp.ini
). Instead follow the steps below:- - Go to
/etc/php5/cli/conf.d
- Locate
20-xdebug.ini
or any file containing the namexdebug.ini
. If no file exists create a file namedxdebug.ini
& place the below contents:-
zend_extension=/usr/lib/php5/20090626/xdebug.so
xdebug.remote_host = 127.0.0.1
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_autostart=1
xdebug.ide_key = "PHPSTORM"
NOTE - zend_extension
in the above file should page the value of the zend_extension
as mentioned in xdebug custom installation oage.
- Start PhpStorm & on the main toolbar click
- Select
PHP
on the left panel underProject Settings
. - Select
PHP language level
as5.4
from the drop-down. - Under
Interpreter
click Browse button - In
Interpreter
window click+
button 1.Select interpreter path
as/usr/bin/php
. 2.Debugger
asXdebug
- Under
PHP
node inside . Click onServers
. Add your service name and port. SelectDebugger
asXdebug
. The figure given below shows a service namedindfas.alice
running at port 80. - Add
Debug
Configurations. ClickRun
on the main toolbar of PhpStorm - Select
Debug
and thenEdit Configurations
. - Click
+
. - Then select
Php Web Application
- And then enter your
Server
,Start Url
&Browser
- Click on
Ok
- To debug add a breakpoint on the line (
ctrl+shift+b
) then clickRun
-->Debug
from main toolbar.
By default the Php that is installed on Ubuntu 12.04 LTS is Php 5.3 but for Xdebug to work correctly we need Php 5.4. To install Php 5,4 please follow the stackoverflow link.
If the PhpStorm is facing trouble on connecting to xDebug please add the below environment variable:-
export XDEBUG_CONFIG="idekey=PHPSTORM"