_php skills of setting up PHP5.6 environment under WIN8.1

Source: Internet
Author: User
Tags php language learn php zend

First contact with PHP in 2014-May or so, was its own main direction is C #, PHP is more repulsive, many of the reasons is that PHP breakpoint debugging has been unable to configure the success, with the Echo print log way of error, so that their own to PHP heart resentment, And missed a good chance to learn PHP in depth. This writing this essay, on the one hand is to record the direction of their own PHP set sail, on the other hand is also hoping to help just contact the beginners of PHP, can smoothly configure the PHP environment, without fear of PHP.

Introduction of System environment

Windows systems are a very common system. I believe there is no more explanation here. So how to turn on IIS (win8.1), in fact, there are many tutorials online, I only do a simple introduction.

  ① install. NET Fromework 3.5

The IIS operation relies on. net3.5, so the first step is to install. NET fromework3.5. There are approximately two ways to install, one is online download, very slow (really very slow), here to introduce the second, offline installation. NET fromework3.5. Find the installation of Win8 ISO file, loaded into the virtual optical drive, if there is a U disk system inserted u disk can be. Run command Prompt (Admin) (right-click the desktop's win icon), enter the command "Dism.exe/online/enable-feature/featurename:netfx3/source:v:\sources\sxs", The V disk represents the disk character of the virtual CD drive or the disk character of the U disk.

  ② Open IIS

To do development, the opening of IIS should be a small case. There's not much to say here.

Ii. Pre-work

  ① environment and IDE file download

The following is a reference URL, if you can not open or change, please search for the latest version of the file, please search, the following link version date: 2015-4-29 Latest

Phpmanager:http://www.iis.net/downloads/community/2010/09/php-manager-for-iis-7

Php:http://windows.php.net/download

xdebug:http://xdebug.org/

phpstrom:http://www.jetbrains.com/phpstorm/

Xdebug helper:http://www.chromein.com/crx_11294.html

  ② Installation

The initial IIS is not supported PHP, so we first downloaded the PHP Manager this tool, after the successful installation, you can see the PHP Manager in IIS icon, the following figure:

Enter the PHP manager. Subsequent configuration is relatively simple, please own Baidu, the focus of this article is to say breakpoint debugging, so not much long-winded. After the PHP configuration is complete, you will see the following interface:

Copy the downloaded Xdebug uncompressed files to the Ext folder in the PHP directory

Next is the IDE's installation, Phpstorm installation is very simple, here is not to say, Xdebug Helper is a Chrome extension tool, in the browser input chrome://extensions/, You can then drag the downloaded CRX file into the page.

Third, the configuration

  ①xdebug

Xdebug Configuration web Search a large, here only give my configuration, in the php.ini file, add the following code, note the location of several files.

[Xdebug]; Xdebug configuration
zend_extension= "D:/php/php-5.6.8-nts-win32-vc11-x64/ext/php_ Xdebug-2.3.2-5.6-vc11-nts-x86_64.dll "; loading xdebug
xdebug.idekey=" Phpstorm "
xdebug.profiler_enable=on
Xdebug.trace_output_dir= "D:/php/xdebug-log"; xdebug data file directory
xdebug.profiler_output_dir= "D:/php/xdebug-log"; Xdebug data file directory
Xdebug.auto_trace = on; turn on automatic tracking
xdebug.show_exception_trace = on; Turn on exception tracking
Xdebug.remote_ Autostart = off; turn on remote debugging auto start
xdebug.remote_enable = on; Turn on remote debugging
XDEBUG.REMOTE_HANDLER=DBGP; for Zend The Application Layer Communication protocol Xdebug.remote_host=localhost for studio remote debugging, the
IP address xdebug.remote_port=9001 of the Zend Studio that allows the connection;
Reverse Connect Zend Studio uses port
xdebug.collect_vars = on; collect variable
xdebug.collect_return = on; collect return values
xdebug.collect_ params = on; collection parameter
xdebugbug.max_nesting_level = 10000; If set too small, recursive calls in the function are too many times to report more than the maximum nesting error

  ②phpstorm

Enter PHP settings

  

Select the PHP language setting

Add an interpreter, but if you are running in IIS, you don't need to add an interpreter, but if you open your PHP code directly via Phpstorm, you need to add an interpreter, like the following, press ALT+F2. Running PHP with the interpreter is not required to install IIS

The next step is to configure Phpstorm Debug. In fact, Phpstorm's debug basically has the default settings, but we'd better change it, because maybe 9000 ports are occupied by other applications. So we need to change to another port, for example 9001

Note: The ports here are configured to match the ports in the Xdebug in php.ini, please see the configuration code above.

XDEBUG.REMOTE_PORT=9001 the ports used by Zend Studio

 ③xdebug Helper

It is a chrome plugin, really easy to use, configuration is very simple, directly above the figure


The configuration is basically over. Let's test it here.

Four, breakpoint debugging test

① find the page, open debugging, click on Bugs, choose Debug.



②phpstorm Open the Monitor.


Refresh http://localhost/php/FirstPHP.php Page



Run Result:


The result is correct, and this article is over, hoping to help the viewer.

The above mentioned is the entire content of this article, I hope you can enjoy.

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.