Build a PHP development environment on the Windows platform

Source: Internet
Author: User
Tags php development environment
Build a PHP development environment under the Windows platform
Build a PHP development environment under the Windows platform

Preparing the Software
1. Web server.
Que ' s HTTP Server v0.2
Pros: Open source, do not need to install, GUI configuration, lightweight, need to start when you do not need to quit just like a text editor, very convenient.
Cons: Without rigorous testing, some features may not be implemented.

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

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


2. Database
MySQL is the perfect choice.
http://www.mysql.com/downloads/mysql/Download the Community edition of the Windows platform.
It is quite necessary to find a Chinese reference manual for MySQL on the Internet, for example, I do not have an MSDN program, and the Reference manual is the MSDN of MySQL.

3. PHP
http://windows.php.net/download/Download the Windows version of the PHP parser, version 5.3 above, to support fast CGI mode to and Que's HTTP Server v0.2 mate.

Configuration
1. PHP Parser
Installing PHP on a computer is generally recommended for installation under C:\PHP.
Copy the file Php.ini-development in the PHP installation directory to a configuration file renamed PHP.ini as PHP.
Put "; extension=php_mysql.dll; Extension=php_mysqli.dll" in front of the two lines ";" Remove, save the file to open PHP support for MySQL.

2. Install MySQL database, can be installed as a service, or can not be installed as a service.
If you are installing as a Windows service, run with the system and exit Mysqld.exe, which is the daemon for Mysql, there is a database service on it.
If you do not install as a service, you can run Mysqld.exe manually when needed, and you can either end the process through Task Manager or run "Mysqladmin.exe-u root shutdown" to close it if you need to.

When installing Mysql, the root user does not have a password and can set a new password by running mysqladmin-u root password "Newpass".
Run "Mysql.exe-u root" to log in to the MySQL console, create a database dbname with the creation databases, and create the user through the grant command.
You can typically create a database and a user specifically for a Web server.

3. Web server
After you run que ' s HTTP Server v0.2, open the Configuration window.

Open PHP: Checked.
Php-cgi.exe path: If installed in C:\php then it should be: \ Php\php-cgi.exe.
Port number: 0, which means the PHP parser is installed locally.
Maximum number of processes/connections: Maximum number of php-cgi.exe processes created, 1~25 can be, if developed, set to 5 is sufficient, a php-cgi process can only process a PHP request, if the number of requests exceeds the maximum number of processes, Que ' s HTTP Server The v0.2 will be processed with a queue. Because each PHP request is processed in a very short time (Que's HTTP Server v0.2 uses the caching technology to minimize the processing time of each PHP request), the user can hardly feel the queued delay.
Size of wait queue: set to 0 to indicate no limit.
Extension: Indicates which files will be used as PHP scripts, usually filled with PHP.
Cache PHP Output: Que's HTTP Server v0.2 creates a temporary file on the server to cache the output of the PHP script until the PHP script has finished running before sending the content to the client browser, if unchecked, Que's HTTP server v0.2 is accepting PHP script output at the same time
Sending the data to the client browser requires the client browser to support http1.1 fragment encoding, of course, there is no problem with modern browsers, so this option is generally not selected to make the results appear on the browser more quickly.

When you are finished, press the OK button to save the settings.

Test
1. Testing the Web server
Run Que ' s HTTP Server v0.2, open the browser input localhost, if you can see "Que's HTTP Server v0.2" The word is configured correctly, otherwise you want to modify the configuration according to the prompt information.
2. Test PHP
In the Web server root directory (if not set, the root directory in the directory of Que ' s HTTP server v0.2 executable files in the WWW directory) to create a file named "info.php",
Open input with a text editor Save.
Open Browser, Access http://localhost/info.php If everything works, you can see the configuration Overview of PHP. Congratulations, the PHP development environment is built.

Well, forget about the IDE, EditPlus is good, or simply 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.