Turn from: http://blog.csdn.net/gxiangzi/article/details/6547564
1.PHPEclipse is a plug-in for the development of PHP in Eclipse. Website Download Address: http://sourceforge.net/projects/phpeclipse/
After the decompression, the contents of the features and plugins folders are copied to the features and plugins folders under the Eclipse installation directory, and Site.xml files are copied to the Eclipse root directory. After you restart Eclipse, you will find that the toolbar will have some PHP-related icons, or you can create a new PHP project.
2. Below you want to download installs Apache server, MySQL database and so on a series of things, also want to configure this is very troublesome. I went to the Internet. There is a development package called XAMPP, which combines Apache, MySQL, PHP + PEAR, Perl, OpenSSL, phpMyAdmin, Mercury Mail Transport System and so on a series of things to develop PHP, and there is a free version of the installation. So I chose this development package, the download address is http://sourceforge.net/projects/xampp/
Here you can select the version and install the package type, etc., I am using a Windows version that is free of installation.
3. After the installation of the XAMPP needed materials have been prepared, open eclipse--windows--perference, find PHPEclipse, configure the apache,mysql,php installation path.
4. Small test, find the XAMPP installation directory inside the Xampp-control.exe, open it, in this control panel can control the Apache,mysql, and so on or off the service. We first startapache the service, then enter http://localhost in the browser address bar, return, if the configuration is successful, the page will display it works!
5. Modify the project path of PHP. The default PHP engineering path is in the XAMPP installation directory in the Htdocs folder, how to customize it. Open the httpd.conf file under the Xampp/apache/conf folder, search for the "documentroot" keyword, and customize its value (all) to the directory you want.
Specific configuration:
Reference: http://dev.21tx.com/2010/04/13/13055.html
Just start to contact with PHP, the first important thing is naturally configure the environment, so, and began to toss
No IDE
At the beginning, just want test to be able to configure success, download Apache, php5.3, install start
Apache installation, all the way next, encounter the Server information, casually fill out, installation path itself optional
PHP installation, will download the zip package, extract to the place you want to put, my is D:\Program files\php
Enter the php file directory, find Php.ini-development, or php.ini-production, both can, duplicate a copy, named PHP.ini. Then open the php.ini, find; Extension=php_mysql.dll, will precede; Remove, change to Extension=php_mysql.dll; find: Extension_dir = "./", change it to the absolute path of the EXT subdirectory under your PHP installation directory. For example my: Extension_dir = "D:/program files/php/ext/" This step is very important. Otherwise, PHP will not be able to find the Php_mysql.dll module, can not load. Next, you need to configure the php.ini file with MySQL-related letters
Configure environment variables, followed by path plus; D:\Program files\php
Configure Apache and PHP
Open the httpd.conf file in the Conf subdirectory under the Apache installation directory.
1. Find:
DocumentRoot "xxxxxxx"
Change to a directory of your local Web site content. For example, my:
DocumentRoot "e:/workspace/php"
<directory "XXXXXX" >
Change to a directory of your local Web site content. For example, my:
<directory documentroot "e:/workspace/php" >
2. Find LoadModule, according to your PHP installation directory, in the space below add these two lines:
LoadModule php5_module "D:/program files/php/php5apache2_2.dll"
Phpinidir "D:/program files/php"
3. Find:
DirectoryIndex index.html
Modified to:
DirectoryIndex index.php index.html
4. Find:
AddType application/x-gzip. GZ tgz
Add these two lines:
AddType application/x-httpd-php. php
AddType application/x-httpd-php. html
5. Save httpd.conf
6. In your site directory (for example, my E:\workspace\php\head rush Ajax), manually create a index.php file, content:
<?php
Phpinfo ();
?>
Start Apache, run index.php, appear PHP version information, etc.
PHPEclipse + XAMPP Configuration
Later wrote a bit of code, feeling this will write wrong, inefficient, and then want to use the IDE, selected Ecliplse + PHPEclipse + xampp
The installation of Eclipse is simple, there is no say
PHPEclipse can enter http://update.phpeclipse.net/update/stable/1.2.x through Eclipse's Help-software update-add site and install it
XAMPP I use the EXE installation package, installation can be
XAMPP contains apache,mysql,php, Perl and so on, so just follow this one is enough.
Next is the configuration
First of all, Eclipse's windows-preferences-phpeclipse-php external tools, the path to be reconfigured, specifically not traced
To configure Apache under XAMPP, you only need to configure the DocumentRoot directory in the first of the above methods 6
Windows-preferences-phpeclipse-projectdefault can be configured on a directory based on directory
New project through Eclipse, file index.php, content ditto
Start Xampp (There are icons under the Eclipse menu bar), right-click index.php in the Navigation view on the left, and choose Open PHP Browser
Using PHPEclipse
You may have used Eclipse, but you may not be familiar with it. See resources for an introduction to the Eclipse platform.
The PHPEclipse plug-in for Eclipse is a popular tool for developing PHP applications. Please start Eclipse and designate the workspace directory as Apache's www directory (c:\www on my machine). Now click File > New > Project. The New Project Wizard pops up. Double-click the php folder and select PHP Project. Click Next, enter the project name Debugarticle, and click Finish.
If you set the WEB server to listen on port 80, you do not need to make any changes. Otherwise, go to the Navigator window, right-click on the PHP project debugarticle, select Properties, and then click PHP Project Settings. Click Configure Workspace Settings and modify the appropriate localhost or add a port on which the Web server listens (for example, http://localhost:8080). Click Apply to complete the setup.
The Navigator window should display a project and a. project file. Right-click on the item, just like you did earlier, but this time, select New > PHP File. Replace *.php with the name of the PHP file you want to create, and then click Finish test3.php. A new file should appear in the Eclipse IDE. You may need to navigate to the Php browser at the bottom of the window to view the current output of the PHP file (see Figure 5).
Figure 1. Eclipse's PHPEclipse Plugin
Download the APACHE2.2.3 Mysql 5.0.22 PHP 5.2.0 assumption from the website first: The system disk is c:/ Suppose: The directory status will look like this when installed: apache--> C:\Program files\apache Software foundation\apache2.2 Mysql-->c:\program Mysql\mysql Server 5.0 php--> c:/php Preparation: You need to check that 80 ports, 3306 ports are occupied by other programs before installing them, and if so, you need to remove the appropriate software--------------------------- ----------The first step to install MySQL unpack the package, the implementation of the installation files, most simply follow the default path and installation prompts to install it, you need to be aware that you can not select anonymous users, but also need to put the MySQL path into the system in the path. After the installation is complete, you will need to restart your computer.
After restarting the computer, check the Control Panel]-[management Tools]-[Service to determine if the MySQL service inside is started, and if not, start the MySQL service. Note: The MySQL login in the shortcut is directly logged in as the root user, and the password for the prompt is the root password.
You can create a user's database and a new user in this state of the root user. Commands are as follows: CREATE DATABASE gc0100; Create database grant all privileges on gc0100.* to gc0100@localhost identified by ' gc0100 ';//create local user grant all privileges on gc010
0.* to gc0100@ "%" identified by ' gc0100 ';//create a remote user can then run at [Start]->[], enter CMD, and then execute the command: Mysql–u username –p the database accessed will then prompt for the corresponding user's password. -----------------------------------Step two: Install Apache and configure support for PHP Double-click the installation file Apache_2.2.3-win32-x86-no_ssl.msi, follow the default path and prompts to install it. The default will be installed under C:\Program files\apache Software foundation\apache2.2.
There will be input boxes, prompts to enter the domain name Administrator mailbox, casually fill it out. +----------------------------------------
| NOTE: The Apache service will be installed and started automatically after installation, as a problem arises here: | (OS 10048) typically each socket address (Protocol/network address/port) is allowed only once: | Make_sock:could not bind to address 0.0.0.0:80 ... "Typically IIS takes up 80 ports | Workaround: Open the Control Panel-> service to locate the IIS Admin service shutdown and Disable | Then use CMD to enter command line mode into the directory where you install Apache/apache2/bin +----------------------------------------start Apache, only in the Apache shortcut function,
To start on it.
Then in IE test the success of Apache, input if it works! will indicate the success of Apache installation. ------------------------------------PHP Installation will extract the contents of Php-5.2.0-win32.zip into c:\php to find the php.ini-dist in the PHP directory (it seems to be a habit, In fact, I prefer to use php.ini-recommended) rename to php.ini and copy to Windows System directory (special case: Win2K system directory is C:\Winnt, Windows XP is c:\windows directory.) And then copy all the dynamic libraries in the PHP directory (*.dll) to the system32 directory (Win2K c:\winnt\ system32,windows XP is C:\Windows\System32) and finally C:\php\ext under PHP_ Gd2.dll Php_mysql.dll These two files are copied to the System32 directory (IBID.)---------------------------------configure Apache httpd.conf with Notepad open C:\ Program Files\apache Software foundation\apache2.2\conf\httpd.conf file found Adddefaultcharset iso-8859-1 change it to AddDefAultcharset GB2312 (allow default language encoding to Simplified Chinese) find DocumentRoot "C:\Program files\apache Software" Change it to your web directory, such as: DocumentRoot "d:/www" to find DirectoryIndex index.html index.html.var add index.htm index.php at the back ( Default index.php homepage file)--------------Modular install PHP-----------------------find #LoadModule ssl_module modules/mod_ssl.so this line,
Add a line after this row LoadModule php5_module c:/php/php5apache2.dll (* * ERROR * *) modified to: LoadModule Php5_module "C:/php/php5apache2_2.dll" Reason: Php5apache2.dll only supports Apache version 2.0 and cannot support Apache version 2.2, because our latest Apache version is 2.2.3 so we have to use the new version of the dynamic library Php5apache2_2.dll, You cannot use the old version of the dynamic library. But if you install Apache as version 2.0, you just need to use the old version of the dynamic library, that is, Php5apache2.dll C:/php/php5apache2.dll (Php5apache2_2.dll) Find AddType application/x-gzip. GZ tgz This line for the location of Php5apache2.dll (Php5apache2_2.dll) in your PHP directory, and add a line after this row AddType
application/x-httpd-php. PHP (In fact: the above two lines of red, you can directly add to the httpd.conf file on the last side can also)------------------------------------------ At this time the PHP environment has basically been configured successfully in the Web root directory (such as my D:\php\www) built a test.php (hint: With notepad friend, please avoid file for test.php.txt), the file content as follows PHP code: Echo phpinfo ();?> Restart the Apache service with the browser open if you can see the PHP configuration output Information OK (if you see the download page or the. echo phpinfo (), please check if you have any errors or omissions on the above)--- ------------------------------------Three, configure php.ini and test MySQL, GD2 (php.ini c:\windows php.ini) to find; extension=php_ Mysql.dll will '; '
Remove change to Extension=php_mysql.dll find; Extension=php_gd2.dll remove the front; In order to support the GD library. If extension=php_gd2.dll found; session.save_path = "/tmp" will '; ' Remove. Set the directory where you saved the session, such as Session.save_path = "C:\WINDOWS\Temp";(windows XP) Session.save_path = "C:\winnt\Temp";(windows --------------------------------Restart the Apache service in the Web root directory (such as D:\php\www) to establish testdb.php file contents as follows: PHP code: <?php $link = mysql_connect (' localhost ', ' root ', ' 123456 ');
Here the root and 123456 is the MySQL user and password, please change if (! $link) echo "fail" according to your own situation;
else echo "Success";
Mysql_close ()?> Open with browser if the output is success OK---------------------------------four, phpmyadmin installation configuration Unzip the phpmyadmin-2.6.1.zip to the Web root (d:\php\www\), rename the folder to config.inc.php in the phpMyAdmin or other open phpMyAdmin directory (I've changed the following). : $cfg [' pmaabsoluteuri '] = '; Assume that there is a domain name of the server, can be changed to domain name/phpmyaDMin $cfg [' Servers '] [$i] [' user '] = ' root '; $cfg [' Servers '] [$i] [' password '] = ' easy; Fill in your MySQL user and password separately $cfg [' Servers '] [$i] [' auth_type '] = ' http ';
Here can also be changed to a cookie to save, in the browser open input your username and password, you can manage MySQL is almost, if you want your PHP code to perform faster, then install a Zend Optimizer. To download the method is: After downloading double-click, select Path installation. Ask the php.ini path to fill in the C:/windows installed to restart the Apache service. You should see something more when you look at it.