Home > Backend Development > PHP Tutorial > Build PHP5.6 environment under WIN8.1, build php5.6 under win8.1_PHP tutorial

Build PHP5.6 environment under WIN8.1, build php5.6 under win8.1_PHP tutorial

WBOY
Release: 2016-07-13 09:55:16
Original
846 people have browsed it

Build PHP5.6 environment under WIN8.1, build php5.6 under win8.1

The first time I came into contact with PHP was around 2014-May, and it was my main focus at that time The direction is C#, and I am quite repulsive to PHP. Part of the reason is that the breakpoint debugging of PHP has never been successfully configured. I used echo to print logs to troubleshoot, which made me resent PHP and missed the opportunity to learn PHP in depth. Chance. I am writing this essay this time, on the one hand, to record my departure in the direction of PHP, and on the other hand, I hope to help beginners who are new to PHP, so that they can smoothly configure the PHP environment without fear of PHP.

1. Introduction to system environment

Windows system is a very common system. I believe there is no need to explain more here. So how to open IIS (win8.1), there are actually many tutorials on the Internet, I will only give a brief introduction here.

 ①Install .net fromework 3.5

IIS operation depends on .net3.5, so the first step is to install .net fromework3.5. There are roughly two installation methods. One is to download online, which is very slow (really very slow). Here I will introduce to you the second one, offline installation of .net fromework3.5. Find the iso file for installing win8 and load it into the virtual optical drive. If you have a USB flash drive system, just insert the USB flash drive. Run "Command Prompt (Administrator)" (right-click the Win icon on the desktop) and enter the command "dism.exe /online /enable-feature /featurename:NetFX3 /Source:V:sourcessxs". The V drive represents the drive letter of the virtual optical drive. Or the drive letter of the USB flash drive.

 ②Enable IIS

For developers, it should be a small case to enable IIS. Not much to say here.

2. Preliminary work

 ①Download environment and IDE files

The following is a reference URL. If it cannot be opened or changed, please search it yourself. To get the latest version of the file, please search. The following link version date: latest 2015-4-29

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

Enter php manager. The subsequent configuration is relatively simple, please search it yourself. The focus of this article is on breakpoint debugging, so I won’t go into details. After the php configuration is completed, you will see the following interface:

Copy the downloaded xdebug decompressed file to the ext folder of the php directory

The next step is to install the IDE. PHPStorm installation is very simple. I won’t go into details here. Xdebug helper is an extension tool for Chrome. Enter chrome://extensions/ in the browser and download it. Just drag the crx file into the page.

3. Configuration

 ①Xdebug

There are many Xdebug configurations online. Here I only give my configuration. In the php.ini file, add the following code and pay attention to the locations of several of the files. ​

[Xdebug] ;xdebug配置
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" ;载入Xdebug
xdebug.idekey="PHPSTORM"
xdebug.profiler_enable=on
xdebug.trace_output_dir="D:/php/xdebug-log" ;xdebug 的数据文件目录
xdebug.profiler_output_dir="D:/php/xdebug-log" ;xdebug 的数据文件目录
xdebug.auto_trace = On ;开启自动跟踪
xdebug.show_exception_trace = On ;开启异常跟踪
xdebug.remote_autostart = Off ;开启远程调试自动启动
xdebug.remote_enable = On ;开启远程调试
xdebug.remote_handler=dbgp ;用于zend studio远程调试的应用层通信协议
xdebug.remote_host=localhost ;允许连接的zend studio的IP地址
xdebug.remote_port=9001 ;反向连接zend studio使用的端口
xdebug.collect_vars = On ;收集变量
xdebug.collect_return = On ;收集返回值
xdebug.collect_params = On ;收集参数
xdebugbug.max_nesting_level = 10000 ;如果设得太小,函数中有递归调用自身次数太多时会报超过最大嵌套数错
Copy after login

 ②PHPStorm

Enter php settings

 

Select php language settings

Add an interpreter. In fact, if you are running in IIS, you do not need to add an interpreter. However, if you open your php code directly through phpstorm, you need to add an interpreter, as follows, press Alt F2. Running php through the interpreter does not require installing IIS

The next step is to configure phpStorm’s debug. In fact, phpstorm's debug basically has default settings, but we'd better modify it because port 9000 may be occupied by other applications. So we need to change to other port such as 9001

Note: The port here must be consistent with the port configuration in xdebug in php.ini. Please see the configuration code above.

xdebug.remote_port=9001; Reverse connection to the port used by zend studio

 ③xdebug helper

It is a plug-in for Chrome. It is really easy to use and the configuration is very simple. Just look at the picture above


The configuration is basically over at this point. Let’s test it below.

4. Breakpoint debugging and testing

① Find the page, turn on debugging, click on the bug, and select Debug.



②PHPstorm turns on monitoring


Refresh the http://localhost/php/FirstPHP.php page



Run result:


The result runs correctly. This article ends here. I hope it can be helpful to the viewers.

The above is the entire content of this article, I hope you all like it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/992551.htmlTechArticleBuild a PHP5.6 environment under WIN8.1, and build php5.6 under win8.1. The first time I came into contact with php was Around 2014-May, my main focus at that time was C#, and I was quite repulsive to PHP. Many of the reasons were...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template