Install the LinuxPHP environment and Swoole extension in Cygwin and debug this blog article in PHPStorm for the following purposes:
1. install cygwin under Win
2. install the php environment and php development environment in cygwin
3. install swoole extension
4. set PHPStorm and cygwin to complete PHPStrom remote debugging configuration.
The following is the body:
1. install Cygwin under Win
Download the Cygwin installation package on the official website of Cygwin, here provides 64-bit installation package: https://cygwin.com/setup-x86_64.exe
On the following page, I select the ustc image site. you can select the site corresponding to your country.
In the following interface, you need to search for the related environment for installing php. Note that you need to select php-devel to install the swoole extension by compiling and installing. You need to install the following environments: pecl/automake/gcc-c ++. other php extensions to be installed are determined by yourself.
After completing the above steps, the Cygwin environment installation is complete. Next, you need to configure the Win environment variable.
2. install the php environment and php development environment in cygwin
Set environment variables, which can be omitted later ....
3. install swoole extension
Run the command line of Cygwin. run Cygwin. bat in the installation directory of Cygwin. double-click to run it.
Input php-v in the command line to output the php version information.
Then use
pecl install swoole xdebug
Install swoole and xdebug extensions
After the extension is installed, go to the Cygwin installation directory, and then use the installation directory as the root directory.
Create swoole. ini and xdebug. ini in/etc/php5/conf. d and write the following configuration content to enable the two extensions respectively.
Type php-m in the command line to check whether the two extensions are successfully installed.
4. set PHPStorm and cygwin to complete PHPStrom remote debugging configuration.
Next, configure the PHPStrom and Cygwin environment variables for remote debugging.
In PHPStrom, click File, select settings, find PHP in ages & Frameworks, expand, find Servers, and add a Server by the plus sign,
The name in Server must be consistent with the serverName set in cygwin.
Select the Use path mapping... option under the Host input box.
On the right hand side, set the directory address of your project directory in the cygwin environment.
Enable PHPStrom listening. In Cygwin, enter the following command to start debugging:
php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 /cygdrive/e/CygwinDownload/web/SocketFramework/TsyExample/start.php
All of the above content.