PHP Development Debug Environment configuration (based on Wampserver+eclipse for PHP developers)

Source: Internet
Author: User
Tags php server phpmyadmin

Because the project needs, need to develop PHP project, so have to take a little time to start learning PHP, the process is very crazy, has not started to develop has been a lot of complex environment to build crazy

After many experiments, decided to record the process, but also to let a lot of the same as me from the Zero start learning PHP friends less detours, of course, if the relationship between the various components have any questions, you can also privately talk about my

1 Software Registration

Wampserver

: http://www.wampserver.com/en/#download-wrapper
What I'm going to do is that it contains the 4 necessary software to build PHP:
1. Apache 2.2.21
2. PHP 5.3.10
3. Mysql 5.5.20
4. XDebug 2.1.2
Tip: Why use Wampserver? Because if you install the software separately, the first one is a cumbersome installation, followed by the configuration of each software, and the third is that the software you install may not match each other, and finally, due to the version inconsistency, there may be subtle differences in configuration. The adoption of Wampserver is much better, it contains all the software to build a debugging environment for PHP development (including Xdebug), and there are very few places to configure, of course, you do not need to consider the version of the matching problem.

Eclipse for PHP Developers

: HTTP://WWW.ECLIPSE.ORG/DOWNLOADS/PACKAGES/ECLIPSE-PHP-DEVELOPERS/HELIOSSR1

JDK installation (Eclipse itself runs on the premise that the JDK is installed correctly)

: Http://www.java.net/download/jdk7u60/archive/b11/binaries/jdk-7u60-ea-bin-b11-windows-x64-19_mar_2014.exe

JDK download to pay attention to the version, such as Eclipse is 64-bit, the JDK will also install 64-bit

The installation process, I will not say, the following directly talk about the configuration

One: JDK configuration

1. Right-click: My Computer--〉 Properties--〉 Advanced--〉 Environment variables


2. Locate the "Path" in the system variable and double-click on it to add the following statement at the beginning of the variable value in the popup interface.

D:/common/java/jdk1.6.0_02/bin;

Be careful not to forget the semicolon in the back, then click the OK button on the Edit System variable interface

3. Click "New" on the environment variable interface,

The variable name is: Java_home

The value of the variable is: d:/common/java/jdk1.6.0_02;

Note the semicolon, and then click the OK button on the new system variable interface

4. Click "New" in the environment variable interface to pop up the new system variable interface.

The variable is named: Classpath, and the value of the variable is:.;

Note the dots and semicolons, and then click the OK button all the way to this setting to complete.


Fourth step: Detect the installation configuration is successful

Finish the above steps, the basic installation and configuration is good, how to know the installation is not successful?

Click: Start--〉 Run, enter "CMD" in the popup dialog, then click OK, in the Popup dos window,

Enter "Javac" and then enter, and a list of JAVAC indicates that the installation configuration was successful.


This way after normal, if open eclips still error, may be JDK version and eclips version inconsistent (Bit32 and Bit64)

II: Wampserver Configuration

The first step: Apache configuration

Usually the programmer, 80 of the port on the computer will be occupied, so here to modify Port 80 is 8088 port:
(1) Left-hand tray icon, in Apache can directly open httpd.conf, find listen 80, can be changed to other ports, I choose 8088.
(2) Restart the Wamp, it will be effective. But localhost, phpMyAdmin, Sqlitemanager, you can click Open to see that the default port is still 80. Locate the Wampmanager.tpl file in the Wamp installation directory, Notepad open: Add 8088 port after http://localhost, save, exit and reopen wamp take effect. (In fact, a similar URL address in the Wampmanager.ini file changes as well)

To modify the WWW directory:

(1) Need to modify Apache httpd.conf file, there are 2 changes: Search similar documentroot "d:/wamp/www/" and <directory "d:/wamp/www/" >
Modified to DocumentRoot "e:/dev/web/" and <directory "e:/dev/web/" >
(2) Wampmanager.tpl file, modified as follows: FileName: "${wwwdir}" to filename: "E:/dev/web"
(3) Wampmanager.ini file, modified as follows: [Menu.left] under filename: "d:/wamp/www" modified to FileName: "E:/dev/web"

Note: After modifying the path, the error will be: Unable to open Wampserver's config file, please change path in index.php file

Workaround: Open index.php in the new path, modify $wampconffile = ' d:/wampserver/wampmanager.conf '; (actual path)

Configuration of the Xdebug
A lot of information on the Internet to manually download Xdebug and configuration, but this version of the Wampserver contains Xdebug (located under C:\wamp\bin\php\php5.3.8\zend_ext), and automatically configured. So we basically do not need to configure what, the only thing to match is to open the C:\wamp\bin\apache\Apache2.2.21\bin under the php.ini, find the last few lines of xdebug.remote_enable = off, Change to xdebug.remote_enable = on. This is done to allow you to enter breakpoints when debugging in Eclipse.

Modify MySQL Database password

Wampserver The default installation of the database is not the corresponding access password, here we need to set the following password

1, left-click, select "PhpMyAdmin", will open the PhpMyAdmin Management page, click on the upper right of the "permissions", the general situation will appear in the table, we have to do is click on each line of user name root to the right.

2, click, find two of the changes shown in the password area, fill in the password to change, and then click on the bottom right of the execution, a moment after the change will appear above the successful prompt, each root user need to do this operation, if 1:30 will not think of a good password, you can also use "Generate password" function to generate a random password, but this password must be remembered, forget the trouble can be big.
Note: After changing the password, you can see that the corresponding account password bar is changed from "No" to "yes", such as the Green circle part. Then add a new user (detailed next), delete the user, such as the Red Mark section to complete the operation!

3, after the above operation to restart the MySQL service, and then refresh the page, we will find that there is a mistake, this is why
Because we have just modified the MySQL password, but did not modify the phpMyAdmin and MySQL communication password, how to change it? Open the Wampserver installation directory, open the \wamp\apps\phpmyadmin3.3.9 in turn, and use Notepad or the DW software to open the config.inc.php inside to find "$cfg [' Servers '] [$i] [' Password '] = ";", in the last two single quotes, enter the password you just modified, and then save, after the operation is finished and then refresh the phpMyAdmin page, is it back to normal?

Eclipse Configuration

One: Configuration workspace

To open eclipse for PHP developers, you need to set the workspace, which must be set to the Wamp www directory, otherwise you will not be able to debug. My www directory is C:\wamp\www.
Configuring the Debugging Environment
Go to eclipse--window–preferences set PHP executable. Need to be aware of the path to the php.ini, where the path is Wamp server, which is placed in the Apache directory

Set Php-->debug, select Xdebug

Two: Configure PHP Server
PHP server is set to the default, because we changed the port of Apache to 81, so we have to make corresponding changes:

PHP Development Debug Environment configuration (based on Wampserver+eclipse for PHP developers)

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.