Using PhpStorm For WordPress Debugging & Development
If you haven’t already installed PhpStorm, you can find a free, fully functional 30 day trial for either Macintosh or Windows from their website at http://www.jetbrains.com/phpstorm/. The installer is typical and straightforward. Simply install using the defaults. To work with DesktopServer, make sure you have checked the ‘Debug and Trace’ check box in DesktopServer. You can find this setting in DesktopServer’s first main menu option ‘Stop or restart…’. Be sure to select the ‘Restart’ option followed by clicking the ‘Next’ button.
Create New Project from Existing Files
If you haven’t already created a DesktopServer website, take a moment to try the simple www.example.dev.cc website as outlined in “Getting Started with DesktopServer”, steps 1 to 10. Adding your existing website to PhpStorm requires a few extra steps. From PhpStorm’s main dialog, select the option to “Create New Project from Existing Files”.
DesktopServer will personalize your website project with its own isolated, unique domain name in addition to its own document root. Therefore, when PhpStorm prompts you to “Choose Your Scenario”, simply select the first option titled, “Web server is installed locally, source files are located under its document root”.
PhpStorm will then prompt you to “Choose Project Directory”. This will be your website’s root folder. By default, DesktopServer creates your site root as a folder with the same name as your website’s domain name and as a sub-folder at ./Documents/Websites. Select the folder and click the “Next” button to continue. For our www.example.dev.cc website, we’ve selected the ./Documents/Websites/www.example.dev.cc folder.
Next, PhpStorm will ask you to “Add Local Server”. You will want to fill out the name field (we use the website’s domain), i.e. www.example.dev.cc. Then fill out the personalized “Web server root URL” field as it was created in DesktopServer, i.e. http://www.example.dev.cc. Note that DesktopServer distinguishes between a www and no-www websites. Make sure that the URL matches that domain name you created in DesktopServer. Click the “Next” button to continue.
Click Next and PhpStorm may show an Untrusted Service's Certificate dialogue. Click accept to continue. PhpStorm will then prompt you to “Specify a Web Path”. Leave this field blank, Click the “Finish” button.