Install the LinuxPHP environment and Swoole extension in Cygwin and debug it in PHPStorm.

Source: Internet
Author: User
Tags php development environment
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.