This article mainly shares with you the tutorial on how to configure the PhpStorm development environment under Mac. First, we download a phpStorm 7.1. I usually work on the mac system, so here I only introduce the configuration of the mac system artifact.
I don’t need to say more about installation.
After the installation is successful, run it next.
After running, of course, a new project is created. To be simpler, we create an empty project. As I said just now, it is an empty project, so let's add some stuff to it, create a new php file, and name it index for the time being.
Then let's give it some content, that's it, the simplest way is to use helloworld.
12345678 Copy after login |
<html><head> <title>PHP 测试</title></head><body><?php echo '<p>Hello World</p>'; ?></body></html> Copy after login |
Then we click Run
A dialog box will appear
There is an error below, which means that the php interpreter was not found. Click Fix at the back, and the following dialog box will appear:
See, interpreter settings. The mac system has PHP installed by default, and the directory is /usr/bin, so we click the button at the back and specify the PHP interpreter directory.
Click OK after configuration.
After configuration, there is an interpreter.
Theoretically, this configuration is complete, but if you click on the chrome icon on the right side of the picture below
, you will see a 502 error ,
After returning to PhpStorm, you will see a warning that php-cgi was not found
The solution is to install it yourself php, no need to install it on mac, so you have a php development environment. The installation is very simple, just run a command, it will take a few minutes, please wait.
1 Copy after login |
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5 Copy after login |
The newly installed php directory is /usr/local/php5/bin. Next, set the newly installed php interpreter in PhpStorm: PhpStorm->Preferences->PHP will come to the interpreter settings page
Set the php interpreter we installed:/usr/local/php5/bin
Now the configuration is complete, put the mouse in the right area of PhpStorm, Then click on the browser installed on your computer, and the browser will open to display the content of index.php
If you want to trigger debugging from the web page, you need to install a plug-in. I use chrome and need to install Xdebug helper
At this point, the artifact PhpStorm for Mac has been configured and you can start your php journey.
Related recommendations:
PHP editor PhpStrom runs slowly
PHPStrom Detailed explanation of new FTP project and online operation management
PhpStrom configuration Xdebug under Mac
The above is the detailed content of Tutorial on how to configure PhpStrom development environment on Mac. For more information, please follow other related articles on the PHP Chinese website!