Reproduced from: http://www.ifun.cc/blog/2014/02/09/macxia-pei-zhi-shen-qi-phpstromkai-fa-huan-jing/
PHP is so popular that it must be studied. First have to find useful tools, see online great God are recommended artifact phpstorm, then I also chasing the herd, download a phpstorm 7.1. Usually work in the Mac system, so here is only the configuration of the Mac system artifact.
I don't have to say much about installing it.
Once the installation is successful, the next step is to run.
After running of course is to create a new project, simply a little, we create an empty project. Just said, is empty engineering, then we give it a little bit of material, a new PHP file, for the time being named index.
Then we give it a little bit of content, that is that, the simplest, with HelloWorld.
Then we click to run
A dialog box will appear
Here is an error that says no PHP interpreter was found. After you click Fix, the following dialog box appears:
See, interpreter settings. Mac system is installed by default PHP, directory is in/usr/bin, then we click on the button behind, and then specify the PHP interpreter directory.
Click OK after the configuration is OK.
Once configured, there is an interpreter.
The configuration is theoretically complete, but if you click on the Chrome icon on the right side of the image below,
You're going to see 502 mistakes,
When you get back to Phpstorm, you'll see a warning that php-cgi didn't find it.
The solution is to install PHP yourself, without the Mac installation, so there is the PHP development environment. Installation is simple, run a command directly, need a few minutes, please wait slowly.
1
|
Curl-s http://php-osx.liip.ch/install.sh | Bash-s 5.5 |
The newly installed PHP directory is/usr/local/php5/bin, and then set up the newly installed PHP interpreter in Phpstorm: Phpstorm->preferences->php will come to the Interpreter Settings page
Set up the PHP interpreter we installed:/usr/local/php5/bin
This configuration is complete, put the mouse to the right area of Phpstorm, and then click on your computer installed browser, will open the browser to display index.php content
If you want to trigger debugging from a Web page, you need to install the plugin. I'm using chrome, and I need to install the Xdebug helper.
To this end, the artifact Phpstorm for Mac has been configured to complete and can begin your PHP tour.
The time is hasty, inevitably have a lot of mistakes, still correct. If there is a problem, please leave a message or join the QQ technology group:< Crazy IT People >93916004