In this tutorial I assume that you have already installed and configured the Web server and the PHP engine properly.
If not, please have a look at this tutorial.
In our configuration we use all default properties (like debug port, broadcasting port etc).
- Select your project and open the settings menu.
- Under the project settings you find a PHP entry
- Select the PHP version
- Confiure an interpreter
- Click on the … button
- Click the plus button in the left-handed upper corner
- Chose a name (something like PHP<5.3.6>)
- Under General->PHP Home point to you PHP location (in my case /usr/bin)
- As debugger choose the Zend Debugger
- Submit the form
- If you don’t see the newly configured interpreter directly push the refresh button
- Now you should see the new interpreter (PHP<5.3.6>)
- By clicking on the question mark you can see an overview of your PHP configuration.
Notice that you dont see any debug parts yet. you should not
- Download the Zend Debugger package which corresponds to your operating system here (Studio Web Debugger)
- Locate the ZendDebugger.so file in the directory which corresponds to your version of PHP (e.g. 4.3.x, 4.4.x, 5.0.x, 5.1.x, 5.2.x)
- Copy the file to your Web server in a location that is accessible by the Web server (like /home/foo, /opt/bar or whereever you like the file to be stored).
- Create a phpinfo-page (HowTo)
- Search for the key “Loaded Configuration File” to see which php.ini your system is using
- Edit the php.ini
- Add or extend the zend-section by adding following settings:
[Zend] zend_extension=<path_to_ZendDebugger.so zend_debugger.allow_hosts=127.0.0.1 ;zend_debugger.allow_hosts=127.0.0.1,localhost zend_debugger.expose_remotely=allowed_hosts
- Restart apache.
- Click on “Edit Configurations” (it’s located in the toolbar next to the play-button)
- Add a new configuration- Chose “PHP Web Application” as type
- Set a unique name for your project debug configuration
- Chose “localhost” as server- Point the start URL to the project http root
- Click OK
- Set a breakpoint somewhere in your code (that of course gets executed)
- Start the debugger (debug icon next to the play button)
- Open (if IntelliJ did not already opened a browser on its own) a browser and access the root URL
Now IntelliJ should stop at your breakpoint.