Eclipse for PHP development environment ____php

Source: Internet
Author: User
Tags file copy install php php server php debugger php development environment php download vc9 zend

Build PHP Development environment:
1, prepare and install the following software:
Mysql-5.6.13-win32:http://dev.mysql.com/downloads/is currently being acquired by Oracle, so go to the Oracle website to download


Apache 2.2.25:http://httpd.apache.org/. During the installation process, there will be 3 text boxes, above two input your native IP (such as: 127.0.0.1), enter your email at the bottom. After the installation is complete, Apache starts automatically, and you can test whether Apache started successfully. In the browser's address bar, enter: http://localhost/or http://127.0.0.1, if "It works.", then congratulations, Apache has been installed successfully, while in the lower right corner of the computer, the taskbar has a green The Apache server runs the icon.


Php-5.2.17-win32-vc6-x86:http://www.php100.com/html/download/tools/2011/0125/3748.html. Download the uncompressed ZIP format without installation, and do not use the installer version of the installation package (in this case many PHP extensions are not installed, such as PHP MySQL extension, resulting in the inability to connect to the MySQL database).

In the PHP official online see a new version of the PHP download, so go up looking for the version of Windows, but a look really dumbfounded, a total of four versions, VC9 x86 Non thread safe, VC9 x86 thread safe, VC6 x86 Non Threa D Safe, VC6 x86 Thread Safe, this let me this rookie headache ah, fortunately, PHP website to provide download on the left of the English choose I understand, I guess is how to choose the version of the meaning of it, so began to look up the dictionary and search the Internet, and finally see the specific meaning, Take it and make a memo first. And then give PHP100 an ad, it is said that the boss to give a video demo, I will explain briefly.

First, how to select the PHP5.3 VC9 version and VC6 version

What VC6 is.
VC6 is Legacy Visual Studio 6 compiler, which is compiled using this compiler.
What VC9 is.
VC9 is the Visual Studio 2008 compiler, which is compiled with the Microsoft vs Editor.

So how do we choose which version of PHP to download?
If you are using apache+php under Windows, please select the VC6 version;
If you are using iis+php under Windows, please select the VC9 version.


Ii. How to select the PHP5.3 thread safe and non thread safe version


First of all, thread safe is threaded and, when executed, thread (thread) security checks are performed to prevent new requirements from running out of system resources in the form of CGI execution that starts a new thread. Non thread safety is not thread safe and does not carry out thread security checks at execution time.


Then look at the two ways PHP executes: ISAPI and fastcgi.


ISAPI execution is in the form of DLL dynamic library, can be executed after the user request, after processing a user request will not disappear immediately, so the need for thread security checks, so as to improve the efficiency of program execution, so if you are using ISAPI to execute PHP, it is recommended to select thread Safe version;


The fastcgi execution is done with a single thread, so there is no need for thread security checks, and the removal of thread security checks can improve execution efficiency, so if you are fastcgi to execute PHP, it is recommended that you choose non thread safe version.

The authorities do not recommend that you apply non thread safe to the production environment, so we chose the PHP version of the thread safe to use.


Zend Debugger 5.2:http://www.zend.com/en/products/studio/downloads. Select the studio Web Debugger.


Eclipse for php:http://www.eclipse.org/downloads/. Note that the version is Eclipse-php-helios-sr1-win32. Eclipse's Workspace is set to D:/php_workspace.
After installation, make some basic configuration of eclipse. If you want to enable the development of the application to have better internationalization support, to maximize the support of Chinese output, it is best to make use of UTF-8 encoding.
However, the default character encoding for the Eclipse workspace (workspace) is the operating system default encoding, and the default encoding for the Simplified Chinese operating system (Windows XP, Windows 2000 Simplified Chinese) is GBK or GB18030, The engineering code established in this workspace is GBK or GB18030, and the text file created in the project is GBK or GB18030. If you want to make new projects and documents directly UTF-8, you need to do the following:
Open Window->preferences->general->workspace, the "Thext file Encodiing" is best set to UTF-8, later set up a new project its Properties dialog box text file Encoding is the UTF-8.
Modify the encoding of various files: in Window->preferences->general->content type, there are various file formats under text, select the appropriate file format, and in the following default encoding input box
Enter UTF-8, click Update. For PHP development, it is best to set HTML and PHP file encoding to UTF-8.

2, let Apache load PHP module: conf/httpd.conf, in the tail add the following content, said load PHP module, to pay attention to the version to match.

Phpinidir "d:/php"
LoadModule php5_module "D:/php/php5apache2_2.dll"
AddType application/x-httpd-php. php


1, the compression of the PHP package zip to a directory, such as "D:\PHP";
2, the PHP directory (D:\PHP) php.ini-production file renamed to php.ini,php configuration file is it, modify the following several places, modify the php.ini file copy to the C:\WINDOWS\ directory:
Extension_dir= "D:\PHP\ext", pointing to the path to place the "Php_*.dll" file under the PHP folder.
Doc_root= "D:\php", Apache set the homepage position;
default_charset= "UTF8", modify the default character set, here, if preceded by a semicolon ";", remove this semicolon;
Register_globals=off is changed to Register_globals=on, which makes it effective to pass global variables;
Extension=php_gd2.dll if preceded by a semicolon, remove the semicolon to the same below;
Extension=php_mbstring.dll
Extension=php_myslqi.dll
Extension=php_mysql.dll is used to connect MySQL database;
3, copy the Php5ts.dll file in the PHP directory to the C:\WINDOWS\system32 directory.
4), and finally modify the Apache httpd.conf file. Add the following 2 lines to the end of the file, which means that you can install PHP in a modular way into Apache:
LoadModule Php5_module E:/php/php5apache2_2.dll
AddType application/x-httpd-php. php

Finally, edit path in the environment variable, plus ";D: \php;d:\php\ext"

Increase the system environment variable PHPRC, the variable is "D:\PHP"

(5) Extract the Zend Debugger, the corresponding version of the PHP ZendDebugger.dll copy to the PHP installation directory, modify the php.ini, add the following:

Zend] Zend_extension_ts=d:/php/zenddebugger.dll zend_debugger.allow_hosts=127.0.0.1 Zend_debugger.expose_remotel Y=always

Place the extracted dummy.php under the httpd documentroot directory and d:/php_workspace/to test debugger connectivity in Eclipse (Debug configurations->php Web page->test Debugger),
Success will come out with a success message. (by modifying the WORKSAPCE's corresponding site directory, Configure "default PHP Web Server" can also be placed under the subdirectory of the Web site).

(6) This step is not necessary: in order to prevent future problems, the PHP php5ts.dll, Libmysql.dll, and Ext/php_mysql.dll, Ext/php_ Mysqli.dll (if this extension is used) three files are copied to Windows/system32.
Note that many times there are difficult problems that are not relevant to the code, ten is because the extension does not load correctly (even if the extension_dir in php.ini points to the Ext directory), this is mainly because the PHP module is loaded by Apache, This is two different software, and often there are some collaborative problems. At this point you will be using the extension from the ext under Copy to System32.
     5, configure Eclipse to point to the PHP module:   open Eclipse window->preferences-> php->php Executables->add, add
name:php 5.2.11
executable path:d:/php/php.exe
PHP INI file (optional): D :/php/php.ini
PHP debugger:zend Debugger
     6, configuring the PHP file access URL in eclipse:   Open window->preferences->php->php Server, edit the default PHP Web server entry, change the URL to Http://localhost/Workspace, Note the workspace is added to the URL bar,
This is the directory alias added in httpd.conf.
     7, test: restart Apache after   configuration, and then create a new PHP project named Firstphptest, Of course, we use our d:/php_workspace as Eclipse's workspace directory. Create a new
PHP File in your project, such as the phpinfo.php you use. Content is

<?php

Phpinfo ();


When you right-click on phpinfo.php, Run as->php Web Page.

Reference: http://blog.csdn.net/zhoudaxia/article/details/5271250

Question: Test Debugger Error

so note: If your PHP version is more than 5.3, and is thread safe, then do not waste your time to try, suggest you directly to switch to Xdebug bar. The following official gives the explanation.

The Debugger we provide supports only the Non-thread-safe architecture, which is why it does not load in your configuration .
Zend stopped supporting the thread safe architecture when Microsoft also decided to implement their PHP engine with the fast -CGI architecture which means non-thread-safe.
Best regards,
Massi.

Task: Xdebug installation

NTS non-secure thread TS thread

To http://xdebug.org/download.php Select the Xdebug version you want.

Download and unzip to the location you want.

Join in the php.ini

Zend_extension_ts= "Your PHP root directory/ext/php_xdebug.dll"

If not, switch to

Zend_extension= "Your PHP root directory/ext/php_xdebug.dll"

Then reboot Apache through Phpinfo () and find out if Xdebug was successfully loaded. problem: Xdebug cannot enter breakpoint

Join in the php.ini

; Turn on automatic tracking

Xdebug.auto_trace = On

; Turn on exception tracking

Xdebug.show_exception_trace = On

; Turn on remote debugging to start automatically

Xdebug.remote_autostart = On

; Turn on remote debugging

Xdebug.remote_enable = On

; Collect variables

Xdebug.collect_vars = On

; Collect return values

Xdebug.collect_return = On

; Collect parameters

Xdebug.collect_params = On

Xdebug.trace_output_dir= "E:/xampp/temp"

Xdebug.profiler_enable=on

Xdebug.profiler_output_dir= "E:/xampp/temp"

Xdebug.remote_host=localhost

xdebug.remote_port=9000

Xdebug.remote_handler=dbgp

Finally, remember to restart Apache

Reference: http://www.cnblogs.com/yaksea/archive/2011/08/26/2154154.html

Related Article

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.