William Jiang

JavaScript,PHP,Node,Perl,LAMP Web Developer – http://williamjxj.com; https://github.com/williamjxj?tab=repositories

Tag Archives: XDebug

using PhpStorm edit Remote PHP Project

using PhpStorm edit Remote PHP Project

I have a PhpStorm installed in local Windows, while having a remote CentOS 6.2 Server hoisted in godaddy.com.
How to edit ‘web apps reside in remote CentOS 6.2 Server’ within ‘local phpStorm env’?
Such as Laravel, Symfony2, cakePHP, worldpress project?
The following is the steps:

  1. Make sure a ftp server is running on centos 6.2, such as vsftpd. So local phpStorm can ftp access remote Linux server. In my CentOS 6.2:
    $ ps -e | grep ftp
    30261 ?        00:00:00 sftp-server

    mean the ftp server deamon is running.

  2. In PhpStorm IDE:
    File | New Project From Existing Files
    | Create New Project: Chooise Your Scenario
    | Web server is on remote host, files are accessible via FTP/SFTP/FTPS

  3. Make sure remote CentOS file directory’s permission is correctly: accessible, writable.
  4. Following the steps, config:
    – FTP Type. Here is SFTP (port 22)
    – remote file directory, e.g. /home/user/mvc/
    – remote web server root URL, e.g. http://example.com/
    – specify root folder on the remote server, e.g. /home/ussr/laravel/blog/
    – Specify project web path on remote server, e.g. http://example.com/laravel/blog/
    After done the config, it will auto sftp remote folder to locally PhpStorm Repository.
    Pretty cool!

  5. Now the new Prject can be editable in PhpStorm, using:
    Right click -> Upload to folder to sync the file.
  6. Also Menu -> Run to debug the updating. For debug, make sure XDEBUG is configured in both remote CentOS php.ini as well as local PhpStorm (Ctrl+Alt+S).
    So can debug remote web app in a local phpStorm environment.

  7. What else? It should work perfectly!

tips of using Jetbrains, xdebug and vim

The following are some summary using PhpStorm and vi.

1.vi: jump position

The following includes some strange symbols for vim, however useful:

Ctrl + o takes to previous location.
`. take you to the last change you made.
CTRL-O and CTRL-I seem to take you back and forth (Ctrl-o, Ctrl-i)


Redo / Undo
u: undo last change
Ctrl-R: Redo
U: return the last line which was modified to its original state

2. phpstorm

Excellent IDE: history, github integration, xdebug, code styles, ftp deployment, a lot of features which make development much easier.

// Always:
Ctrl + Shift + a

To navigate to a recently opened file: Ctrl+E
To navigate to a recently edited file:
Ctrl-Shift-E (recently opened file)
Ctrl-E (recently edited file)

Navigate a class, file or symbol with the specified name:
Class: Ctrl+N
File (directory): Ctrl+Shift+N
Symbol: Ctrl+Shift+Alt+N

To navigate to the next/previous change in the editor:
shortcuts: Ctrl+Shift+Alt+Down or Ctrl+Shift+Alt+Up.

Ctrl+b: open the function's source defination.
Ctrl+F12: show herited members.
Alt-click to close other files.

3. xdebug & phpStorm

By using XAMPP’s xdebug, and phpStorm, make drupal debug works in a web-application env.

To start Xdebug, you’ll need to append the XDEBUG_SESSION_START=xxx section to the url, i.e.:

It does not matter which browser you use, as long as the HTTP request is going to the apache/PHP server that has xdebug installed and configured.

Configuring XDebug with PHPStorm:


4. Run node in webstorm

JetBrains’ Webstorm is fabulous. the ctrl+shift+a shortcut key is great, and git is pretty helpful.
Some useful shortcut keys:

PhpStorm Default Keymap – JetBrains

such as CTRL + SHIFT + F,