PHP Environment Setup (windows8.1+iis8.5+php5.6+phpstorm), windows8.1phpstorm_php tutorial

Source: Internet
Author: User
Tags php language

PHP Environment Setup (windows8.1+iis8.5+php5.6+phpstorm), Windows8.1phpstorm


This essay is for beginners ' reference only! Author: Shintoruan, reprint annotated Source: Shintoruan

The first contact PHP was in 2014-May around, at that time is their main direction is C #, the PHP is more exclusive, many of the reasons, is the PHP breakpoint debugging has been unable to configure the success, with the echo print log way wrong, so that their hearts 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 their own PHP direction set sail, on the other hand is also hoping to help newcomers to PHP, can smoothly configure the environment of PHP, and not to fear of PHP.

Introduction of the system environment

Windows systems are a very common system. I believe there is no need to explain more. So how to open IIS (win8.1), in fact, there are many tutorials online, I only do a brief introduction.

① Installing. NET Fromework 3.5

IIS runs on a dependent. net3.5, so the first step is to install. NET fromework3.5. There are basically two kinds of installation methods, one is online download, very slow (really very slow), here to introduce you to the second, offline installation of. NET fromework3.5. Locate the ISO file that installs the WIN8, and load it into the virtual CD drive, if you insert a USB flash drive system. Run command Prompt (Admin) (right-click on the desktop's win icon), enter the command "Dism.exe/online/enable-feature/featurename:netfx3/source:v:\sources\sxs", The V-disk represents the drive letter of the virtual optical drive or the drive letter of the USB stick.

② Opening IIS

For development, it should be a small case to open IIS. There's not much to say here.

Second, pre-work

① environment and IDE and other files download

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

PHP manager: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 does not support PHP, so we first downloaded the PHP Manager tool, after successful installation, you can see the PHP Manager icon in IIS, such as:

Go to PHP Manager. Follow-up configuration is relatively simple, please Baidu, the focus of this article is to talk about breakpoints debugging, so it is not more verbose. When the PHP configuration is complete, you will see the following interface:

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

Next is the installation of the IDE, Phpstorm installation is very simple, here also do not 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 Online 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"; load into Xdebugxdebug.idekey="Phpstorm"xdebug.profiler_enable=Onxdebug.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; application-layer communication protocol for Zend Studio remote debugging Xdebug.remote_host=localhost; the IP address of the Zend studio that is allowed to connect Xdebug.remote_port=9001the reverse Connection Zend Studio uses the port Xdebug.collect_vars=on ; collect variable Xdebug.collect_return=on ; collect return value Xdebug.collect_params=on ; collect parameter Xdebugbug.max_nesting_level=10000If it is set too small, there is a recursive call to itself too many times in the function to report more than the maximum number of nested errors

②phpstorm

Enter PHP settings

  

Select PHP Language Settings

Add an interpreter, in fact, if you run in IIS, you do not have to add an interpreter, but if you open your PHP code directly through Phpstorm, you need to add an interpreter, as below, press ALT+F2. Running PHP through the interpreter is not required to install IIS

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

Note: The ports here are consistent with the port configuration in Xdebug in php.ini, see the configuration code above.

xdebug.remote_port=9001 : The port used by the reverse connection Zend Studio

 ③xdebug Helper

It's a plug-in for Chrome, it's really easy to use, it's simple to configure, direct

To this configuration the basic ended. Let's test it here.

Iv. Debugging test of breakpoints

  ① find the page, open debugging, click Bug, choose Debug.


②phpstorm Turn on monitoring



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


Operation Result:


The results run correctly, to this article also ended, hope to be helpful to the viewer.

http://www.bkjia.com/PHPjc/991535.html www.bkjia.com true http://www.bkjia.com/PHPjc/991535.html techarticle PHP Environment Construction (windows8.1+iis8.5+php5.6+phpstorm), windows8.1phpstorm This essay for beginners only reference! Author: Shintoruan, reprint annotated Source: Shintoruan First Contact PHP is in ...

  • 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.