Build a PHP Development Environment on windows

Source: Internet
Author: User
Tags php development environment

Build a PHP Development Environment on windows

Prepare Software
1. Web server.
Que's HTTP Server v0.2
Advantages: it is open-source, does not need to be installed, GUI configuration, and lightweight. It is very convenient to exit when you need to start it, just like a text editor.
Disadvantage: some functions may not be implemented because they have not been strictly tested.

In general, as the author of Que's HTTP Server v0.2, I think it is worth a try.

Http://blog.csdn.net/querw/article/details/6593328

2. Database
MySql is the best choice.
Http://www.mysql.com/downloads/mysql/ download community edition for windows platform.
It is quite necessary to find a MySql Chinese reference manual on the Internet. For example, I basically won't write a program without MSDN. The reference manual is MySql's MSDN.

3. PHP
Http://windows.php.net/download/ Download Windows version of PHP parser, Version 5.3 or above, to support Fast CGI Mode and Que's HTTP Server v0.2.

Configuration
1. PHP parser
Install PHP on your computer. It is generally recommended to install PHP on C: \ PHP.
Copy the PHP. ini-development file under the php installation directory and change it to php. ini as the PHP configuration file.
Remove "; extension = php_mysql.dll; extension = php_mysqli.dll" before the two rows ";" save the file to enable PHP support for MySql.

2. Install the Mysql database as a service or as a service.
If it is installed as a Windows Service, mysqld.exe is run and exited along with the system. This is the Mysql daemon, and database services are available.
If it is not installed as a service, manually run mysqld.exe as needed. If it is not needed, you can end the process through the Task Manager or run "mysqladmin.exe-u root shutdown" to close the process.

The root user has no password when installing Mysql. You can run mysqladmin-u root password "newpass" to set the new password.
Run "mysql.exe-u root" to log on to the Mysql console, use create database dbname to create a database, and run the grant command to create a user.
Generally, you can create a database and a user for the web server.

3. Web Server
Run Que's HTTP Server v0.2 and open the Configuration window.

Enable PHP: select.
Php-cgi.exe path: If installed in C: \ php then it should be: c: \ php \ php-cgi.exe.
Port: 0, indicating that the php parser is installed locally.
Maximum number of processes/connections: Maximum number of php-cgi.exe processes created, 1 ~ Yes. If it is development, setting it to 5 is enough. A php-cgi process can only process one php request at the same time. If the number of requests exceeds the maximum number of processes, que's HTTP Server v0.2 will be processed using a queue. since each php request processing time is very short (Que's HTTP Server v0.2 uses the cache technology to shorten the processing time of each PHP request as much as possible ), therefore, the user almost does not feel the delay of queuing.
Waiting queue size: 0 indicates no limit.
Extension: indicates which files will be used as php scripts. Generally, enter php.
Cache PHP output: if selected, Que's HTTP Server v0.2 will create a temporary file on the Server to cache the output of the php script and send the content to the client browser after the php script is run, if this parameter is not selected, Que's HTTP Server v0.2 accepts the php Script output at the same time.
Sending data to the client browser requires that the client browser support http1.1 encoding. Of course, there is no problem with modern browsers, therefore, this option is generally not selected to make the results appear in the browser faster.

After entering the information, click "OK" to save the settings.

Test
1. Test the Web Server
Run Que's HTTP Server v0.2. Open the browser and enter localhost. If you can see "Que's HTTP Server v0.2", the configuration is correct. Otherwise, modify the configuration according to the prompt.
2. Test PHP
Create an "info. php files,
Open the input in a text editor <? Php echo phpinfo ();?> Save.
Open the browser and access http: // localhost/info. php. If everything is normal, you can see the php configuration overview. Congratulations, the php development environment has been set up.

Er, forget about IDE. EditPlus is good, or use notepad.

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.