Install IIS/Apache + PHP + MySQL in Winodws

Source: Internet
Author: User
Tags download zend small web server
I have not written many tutorials, and most of them are from others' tutorials. However, what I have introduced here is a summary of my experience. -- Introduction

I have not written many tutorials, and most of them are from others' tutorials. However, what I have introduced here is a summary of my experience. -- Introduction

The execution efficiency of php is obvious to all, which is one of the reasons I like it. to integrate it with MySQL and Apache, which is called a wonderful partner, we can't help but wonder at its efficiency. PHP is also updated very quickly. The latest version PHP4.3.2RC4 is listed here (there are almost no bugs, and it is estimated that the official version will be available soon after the writing), and the installation process of the latest version Mysql4.0.13.

PHP installation files can be directly to the http://www.php.net/download, get for win32.zip package (5.8 M)
Mysql installation files can be downloaded directly to the http://www.mysql.com, get for win32.zip package
In addition, if you want to experience the combination of Apache and PHP and want to give up IIS, please download the latest for win31. MSI installation package in http://www.apache.org, the latest version is 2.0.45.
In addition, you can download Zend Optimizer to accelerate PHP. Specific access to http://www.zend.com

<1> install and configure PHP
1. decompress the PHP compressed package to C: PHP (this path can be used at will, but please modify the path as follows ).
2. copy all the php4ts. dll and C: PHPdlls files under the C: PHP directory to the windows system folder, which varies depending on the Windows version.
C: windowssystem for Windows 9x/ME
C: winntsystem32 for Windows NT/2000
C: windowssystem32 for Windows xp/server2003
C: The system disk of your current operating system. if your current operating system is not installed in C: windows, modify the disk accordingly.
Copy php. ini-dist to C: windows (XP/2003/9 x/Me) or C: Winnt (2000/nt) and rename it php. ini. Open it in Notepad and modify the following information:
Search the extension_dir =./line and point its path to the extensions directory under your PHP Directory, for example:
Extension_dir = C: PHPextensions
If you want to support more modules, follow these steps. if you don't want to, simply save the php. ini file.
PHP supports many modules, but some dll files are not free of charge, so they are not released along with the PHP compressed package. However, there are many modules in the dlls folder, we copied them to the system32 folder just now. now we can test how many modules it supports. The following are my test results for your reference only. if The xxx. dll module is not supported in the pop-up after installation, you can simply add the semicolon (;) and search:
Windows Extensions
; Note that MySQL and ODBC support is now built in, so no dll is needed for it.
;
The following sections describe the supported extension modules with semicolons. if you want PHP to support a certain module, remove the previous ";". The following is the result of my test, it is normal to remove the comment as follows:
Extension = php_bz2.dll
Extension = php_c2.16.dll
Extension = php_crack.dll
Extension = php_curl.dll
Extension = php_db.dll
Extension = php_dba.dll
Extension = php_dbase.dll
Extension = php_dbx.dll
Extension = php_domxml.dll
Extension = php_exif.dll
Extension = php_fdf.dll
Extension = php_filePRo.dll
Extension = php_gd2.dll
Extension = php_gettext.dll
Extension = php_hyperwave.dll
Extension = php_iconv.dll
; Extension = php_ifx.dll
; Extension = php_iisfunc.dll
Extension = php_imap.dll
Extension = php_interbase.dll
Extension = php_java.dll
Extension = php_ldap.dll
Extension = php_mbstring.dll
; Extension = php_mcrypt.dll
Extension = php_mhash.dll
Extension = php_mime_magic.dll
Extension = php_ming.dll
Extension = php_mssql.dll
Extension = php_msql.dll
; Extension = php_oci8.dll
Extension = php_openssl.dll
; Extension = php_Oracle.dll
Extension = php_cmd.dll
Extension = php_pgsql.dll
; Extension = php_printer.dll
Extension = php_shmop.dll
Extension = php_snmp.dll
Extension = php_sockets.dll
; Extension = php_sybase_ct.dll
Extension = php_w32api.dll
Extension = php_xmlrpc.dll
Extension = php_cmdt.dll
Extension = php_yaz.dll
Extension = php_zip.dll
After the modification, save php. ini and install and configure PHP.

<2> install Mysql
Mysql is relatively independent. This database is very small and cannot be operated directly. it is not as intuitive as access or SQL2000. However, there are already a lot of software that can perform well on it, for example, phpMyAdmin and mysqlcc. These software can be downloaded from the http://www.mysql.com, which is not detailed here.
After downloading and obtaining the Mysql for win32installation package, open it with winzipand run setup.exe directly. Note that you should select an installation path. of course, the installation path can be any, but I suggest installing it with PHP and selecting the C: MySQL directory. After the installation is complete, MySQL is complete. For setting users and passwords, you can use the two software mentioned above for management. The description is not continued here. the default username is root and the password is blank.
Usually after the installation of MySQL will automatically start the service, if not started, please run C: MySQLbinmysqld-nt.exe

The next installation depends on what you choose as your Web server. I suggest using Apache. if you think it is in conflict with your IIS, use IIS directly.

<3> IIS configuration:
Open IIS, right-click on "default Web site" to open properties, and perform the settings shown in the following figure in the main directory. Note the steps:


After that, the IIS + PHP + MySQL environment is set up.

<4> If you do not have IIS, install Apache, a small Web server:
We downloaded an Msi installation file for win32. after you double-click it, Apache installation is automatically executed. follow the prompts to install it, the content to be written is filled in according to your preferences, which has no effect. of course, the directory I suggest you and the PHP directory should be selected C: Directory. after installation, you can see C: apache2. After installation, the apache icon is displayed in the system tray in the lower right corner of the desktop. you can double-click the Apache control panel to stop or restart the server.
Here we need to modify the C: Apache2confhttpd. conf file and open it in Notepad:
Find:
# NameVirtualHost *
To:
NameVirtualHost 127.0.0.1
Find:

Modify the following lines:
ServerAdmin (the administrator mailbox you entered during installation)
DocumentRoot c: Apache2htdocs
ServerName Apache2
ErrorLog c: Apache2logserror_log
CustomLog c: Apache2logsaccess_log common

Find:
AddType application/x-tar. tgz
Add the following two lines below:
AddType application/x-httpd-php. php
AddType image/x-icon. ico
Find:
# LoadModule ssl_module modules/mod_ssl.so
Add a row below:
LoadModule php4_module C: phpsapiphp4apache2. dll
Add default files:
Find the DirectoryIndex * line. you can add the default file name as follows:
DirectoryIndex index. php default. php index.htm index.html default.htm default.html
Save the file and restart the apache server.

The PHP environment has been fully established.

<5> Zend Optimizer installation (optional)
After the download is a. exe file, you can install it directly. you must select the PHP version during the installation process. here, I select php 4.3.x to check whether to back up php before installing. ini. Click OK and the installation will end.
Open php. ini and modify the following content:
Find:
[Zend]
You can see below:
Zend_optimizer.optimization_level = *
This line,
Change the value after = to 1023, that is, change this line
Zend_optimizer.optimization_level = 1023
After saving, it will be OK. restart Apache/IIS and the installation is complete. I am also very tired :)

<6> test:
Use Notepad to create a new file, write down the following lines, and save them to the C: Apache2htdocs directory, which is your site and directory named phpinfo. php. enter http: // localhost/phpinfo in the browser. php will be able to see as much information as possible about PHP.
CODE

Phpinfo ();

?>

Note that when you save the file, the file suffix should be. php. (Notepad will automatically add a. txt suffix after the file name, unless you take one of the following measures to avoid this situation .) When you save the file, the system will ask you to specify the file name. in this case, enclose your file name with quotation marks. (For example, "hello. php ".) Alternatively, you can click the "Save type" drop-down menu in the "Save type" dialog box and change the settings to "all files ". In this way, you do not need to use quotation marks when entering the file name.
The above paragraph from the PHP Chinese manual, more detailed installation information, please download this Chinese manual http://www.php.net/docs.php, which has a variety of different systems installed in detail, but not very intuitive, some optimizations have not been written out yet :)

Below I will provide a few of the software to be used:
PHP4.3.1 stable version:
Http://www.blueidea.com/download/forum/php...4.3.1-Win32.zip

MySQL 4.0.13 stable version:
Http://www.blueidea.com/download/forum/mys...-4.0.13-win.zip

Apache2.0.45 stable version:
Http://www.blueidea.com/download/forum/apa...-x86-no_ssl.msi

Zend Optimizer:
Http://www.blueidea.com/download/forum/zendoptimizer-236912.16.1.0a-windows-i386.exe

In addition, PHP4.3.2RC4 contains the PEAR package, which is not found in PHP4.3.1. if you have downloaded the package, set the include path in php. ini and find the following two lines:
Windows: "path1; path2"
; Include_path = ".:/php/shortdes"
To:
Windows: "path1; path2"
Export de_path = "C: phppear"
Save the file. this is the path of the PHP file. you can set multiple file paths. use.

Note: This article will inevitably have errors and omissions, hope to point out, at the same time hope to be helpful to friends who like PHP. reprint please contact me: kim@showtop.net


Reference: http://www.knowsky.com/3060.html

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.