Php development environment configuration process

Source: Internet
Author: User
Tags php development environment
Document directory
  • 1. install Apache
  • 4. Configure HTTP. conf in Apache
  • 5. Configure PHP. ini
  • 7. Test
  • 8. phpstduy Software
  • 9. Other questions about PHP configuration

I confirmed my work a few years ago, so I plan to use my graduation thesis to learn about PhP development. The first step in any language learning process is the successful configuration of the development environment, so I spent one morning setting up the environment successfully.

Php development environment configuration process

This configuration is mainly used for configuration and installation in Windows XP. The configuration and installation in Linux will be supplemented later.

I. Required Software

Windows XP SP2 (IIS is not installed or IIS is disabled)
Apache_2.2.4-win32-x86-no_ssl.msi (http: // 61.163.93857: 82/down/apache_2.2.4-win32-x86-no_ssl.zip, Application Server)
Php-5.2.12-Win32.zip (http://cn.php.net/distributions/php-5.2.12-win32.zip,php5software package)
Pecl-5.2.1-Win32.zip (www.php.net, PhP5 PECL extension module set package)
Mysql-noinstall-5.0.22-win32.zip (www.mysql.com, database management system)
ZendOptimizer-3.2.6-Windows-i386.exe (PhP program accelerator, http: // 61.163.93857: 82/down/ZendOptimizer-3.3.0a-Windows-i386.zip)

Ii. Installation Process 1. It is very easy to install apacheapache. The path is E:/apache2.2, and next, next, and finish. You must enter the network domain, server name, and administrator's email address. Enter the following information: Check whether there is a conflict with anti-virus software in the system and compete for port 80. If yes, after the installation is complete, you can open http: // localhost in the browser to check whether the IT work is correct. 2. Install PHPDecompress php-5.2.1-win32.zip to E:/PhP5. Then, all the files in pecl-5.2.1-win32.zip (*. DLL ,*. jar) decompress it to the E:/PhP5/EXT directory. The ext directory is the PHP search extension library and storage extension library location. Then add the following environment variables to "my computer"> Properties> advanced> environment variables (we recommend that you restart the system after setting the environment variables): phprce: /PhP5/phpexte:/PhP5/EXT path; E:/PhP5; E:/apache2.2

3. Install MySQLInstall MySQL and download the decompressed version. I personally think that the decompressed version of MySQL is easy to use and the installation method is simple. Refer to another article on this site and I will not repeat it here.

4. Configure HTTP. conf in Apache to open the E:/apache2.2/CONF/extra directory and create a file named httpd-php5.conf with the following content (note the path Separator in it ):
Loadmodule php5_module "E:/PhP5/php5apache2_2.dll"
 
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP-source. PHPs
 
Directoryindex index. php
 
Phpinidir "E:/PhP5"
 
Open E:/apache2.2/CONF/httpd. conf.
Include CONF/extra/httpd-php5.conf5. configure PHP. INI. rename ini-Dist to PhP. INI, find the extension_dir = ". /", change it to extension_dir =" E:/PhP5/EXT"
Then enable the corresponding *. dll file, that is
; Extension = php_bz2.dll
; Extension = php_curl.dll
...
Change
Extension = php_bz2.dll
Extension = php_curl.dll
...
When we set Apache, we select the phpinidir directory in our PHP installation directory, so we do not need to copy PHP. ini to the Windows directory. Also, if you want to call mcrypt, mhash, and MySQL, remember to copy libmcrypt. dll, libmhash. dll, and libmysql. dll in the PHP Directory to the System32 directory in the Windows directory. 6. Install Zend Optimizer
Zend optimizer is the Accelerator Used for PHP. It is relatively simple and can be operated as prompted. It is not described here. 7. Create a phpinfo. php file in E:/apache2.2/htdocs. The content is as follows:
<? PHP
Phpinfo ();
?>
 
Create the testdb. php file in E:/apache2.2/htdocs. The content is as follows:
<? PHP
$ Link = mysql_connect ('localhost', 'root', 'root ');
If (! $ Link) echo "database connect fail ";
Else echo "database connect success ";
Mysql_close ();
?>
 
Run the Apache server, enable the MySQL database, and enter
Http: // localhost/phpinfo. php
Http: // localhost/testdb. php
Test. 8. The phpstduy software phpstudy package integrates the latest Apache + PHP + MySQL + phpMyAdmin + zendoptimizer for one-time installation and can be used without configuration. It is a very convenient and easy-to-use PHP debugging environment. This program includes not only the PHP debugging environment, but also development tools and development manuals. To learn PHP, you only need one package. For beginners who are new to PhP, it is very difficult to configure the environment in windows. It is also cumbersome for veterans. Therefore, whether you are a newbie or veteran, this package is a good choice. Note: during the installation process, if a firewall is enabled and the service is registered and started, the system will prompt whether to trust httpd, mysqld-nt to run, and port 80 and 3306. Select allow.
9. Other questions about PHP configuration 9.1 modify the default directory of PHP: D: /program files/Apache Software Foundation/apache2.2/htdocs: If you want to test a webpage, You must place all the webpage code under this directory to facilitate project development, we can modify it. The modification process is as follows: 1. Find the Apache configuration file httpd. conf under D:/program files/Apache Software Foundation/apache2.2/CONF. 2. Open httpd. conf in notepad or another text editor. 3. Find the keyword DocumentRoot and change the value to D:/phpweb to set this directory as the default directory. Restart Apache after modification. 4. But test D:/phpweb directory. A message indicating a denial of service is displayed below. Modify the following key points: Find <directory "D:/program files/Apache Software Foundation/apache2.2/htdocs">... </directory> to <directory "D:/phpweb">... </directory>, restart Apache to view the page information.

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.