Build an eclipse-based php development environment in Windows

Source: Internet
Author: User
Tags php development environment

Before configuring eclipse, you first need an Apache + PhP basic environment that can be installed with wampp or PHP home. They are integrated and easy to install. We recommend that you install wampp2.2 and integrate Apache, MySQL, Perl, and PHP. And decompress the package.
Next I will take wampp2.2 installation as an example to explain step by step how to configure the eclipse-based php development environment.
1. install and configure wampp2.2
In this example, we will decompress the downloaded wampp-2.2.zip file to C: wampp2. You can follow this to draw a line. Shows the directory structure after decompression.

Wampp contains the following content:
+ Apache 2.0.46
+ MySQL 4.0.13
+ PhP 4.3.2 + Pear
+ Perl 5.8.0
+ Mod_php 4.3.2
+ Mod_perl 1.99 _ 10 Dev
+ Mod_ssl 2.0.46
+ Mod_auth_mysql
(Only experimental)
+ OpenSSL 0.9.7b

The configuration is complete. We need to modify a few items. The first option should be Apache DocumentRoot. This is the root directory of the web service. Here we set it to F: workspace, the working directory of eclipse will also be set to this location later. You can configure other configurations as needed.
Install Apache as a system service
In this example, install Apache as a service, enter the directory c: wampp2apache, and double-click apache_installservice.bat to install Apache as a system service.
Open "Management Tools" in "Control Panel", find "services", and you will see apache2. Double-click to open "apache2 attribute, setting the "Start type" to "Manual" can save system resources and speed up the startup. This is my personal habit. You don't need to change it, you can enable Apache automatically at startup.

Apache is not started yet. We will not start it for the moment.

Ii. Download and install eclipse
: Http://download.eclipse.org/downloads/index.php. To choose eclipse 2.1.x Version Download, eclipse needs JRE support, so if the machine has not installed JRE, then hurry to download a installed, http://java.sun.com has JRE download.
Set
Download the eclipse compressed package and decompress it directly. I will decompress it to C: Eclipse, then perform this directory, double-click
Eclipse.exe. If the startup prompt requires JRE support, it indicates that you have not installed
JRE, or the JRE path is not found. In this case, you only need to right-click "my computer" and select "attribute". In "advanced", there is an "environment variable" item, find "path"
You can add the JRE path later. If you are in trouble, copy the JRE directly to C: Eclipse.
Now eclipse can run normally, turn it off, continue to the next step, install the PHP plug-in.

3. download and install the PHP plug-in eclipse
Http://sourceforge.net/project/showfiles.php? Group_id = 57621 & package_id = 53190. After the download is complete, decompress the package and copy the decompressed folders to the Plugins directory of the eclipse main directory. In this step, even if the PHP plug-in eclipse is ready, we can create a PHP project in eclipse and support PHP syntax highlighting. Let's take a look.
Create a PHP project:
Step 1: file-> New-> project. Check if you have a PHP project.

Step 2: set the project name and set the project directory below, which must be in the same directory as the configured Apache DocumentRoot above to be accessed through a browser for debugging convenience. For example, for the path shown in, the browser uses http: // localhost/itrootcms/

Then finish and the creation is complete.
Create a file and write several linesCodeTry it. How about it? Good results.

However, this is far from enough. We need to configure more content.

4. Configure the PHP plug-in
Under the Windows menu of Eclipse, select
Preferences, find PHP on the left, and select the configuration parameters of Apache and MySQL. Enter the parameters according to your own situation.ArticleAchieve
Now, your configuration should be the same as the figure below. Here you set to run Apache in the background rather than services, so if you have set Apache
Services run. You do not need to worry about it here.

The built-in help system also needs to use the official php chm file, which can be downloaded here: Ghost.

I just talked about how to configure the backend to run Apache in ecilpse.
In the window menu, select customize
Perspective, and then expand other. There is a "PHP/Apache" item in it. Check it and make sure that you can start Apache and MySQL.
Button, such.

You also need to configure a plug-in for php SQL. The preferences in the window menu has a php SQL item, and the connecting item under it is filled in with the correct location of the MySQL JDBC driver, you can download the latest version: http://www.mysql.com/downloads/api-jdbc-stable.html here

Then you can use the functions of database bookmarks and other MySQL databases. The following figure shows how to demonstrate the main database functions, in fact, they can easily hide the display.

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.