Install Linux PHP environments and swoole extensions under Cygwin and debug in Phpstorm

Source: Internet
Author: User
The purpose of this blog is to have the following points:

1, win under the installation of Cygwin

2. Install PHP Environment and PHP development environment in Cygwin

3. Install Swoole Extension

4. Set Phpstorm and Cygwin to complete the remote debugging configuration of Phpstrom

The following is the body part:

1, win under the installation of Cygwin

Download the Cygwin installation package on Cygwin's official website, which provides the download address for the 64-bit installation package: Https://cygwin.com/setup-x86_64.exe

In the following screen I chose the USTC mirror site, you can choose to correspond to your country's site on the line

In the following interface, you need to search for the installation of PHP environment, note here to choose Php-devel, in order to use the installation of a compilation Swoole extension. The environment you need to install is: pecl/automake/gcc/gcc-c++, other PHP extensions that need to be installed are your own decision

The above step completes basically represents the Cygwin environment installation completes, next need to configure the WIN environment variable.

2. Install PHP Environment and PHP development environment in Cygwin

Set the environment variables, this step later found can actually be omitted ....


3. Install Swoole Extension

Run Cygwin command line, run in the Cygwin installation directory has a cygwin.bat, double-click to run.

Typing php-v on the command line will output PHP version information

Then use

Pecl Install Swoole Xdebug

Installing Swoole and Xdebug extensions

After the extension installation is complete, go to the installation directory of Cygwin and follow the installation directory as the root directory.

In/etc/php5/conf.d, the new Swoole.ini and Xdebug.ini are written in the following configuration, respectively, to open the two extensions

Verify that the two extensions are installed successfully by typing php-m on the command line, indicating that the installation was successful


4. Set Phpstorm and Cygwin to complete the remote debugging configuration of Phpstrom

Next, configure the environment variables for Phpstrom and Cygwin for remote debugging

In Phpstrom, click File Select Settings, find PHP in Languages & Frameworks, expand to find Servers, press the plus sign to add a server,

The name in the server should be the same as the ServerName set in Cygwin.

Then tick the use path mapping under the host input box ..... The options

Set your project directory on the right-hand side directory address in the Cygwin environment

Turn on Phpstrom monitoring. In Cygwin, enter the 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



The above content is the entire 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.