Configuration of PHP5 and Apache servers in a Windows environment

zhaozj2021-02-16  153

In the Windows environment

PHP5 and APACHE server configuration

Deep empty @PHPE / article

At present, PHP5 releases the third candidate version, and it is estimated that official version will soon release it. The installation process should not change, the following article content will tell the configuration of the PHP environment under Windows2000 / XP / 2003 (not recommended to establish a PHP environment under Windows 98), the server selection Apache

2.0.49

Database Select the mysql version 4.0.20 version. Need to download a few packages:

PHP5 RC3 2. Apache

2.0.49

3. MySQL 4.0.20 Download Package 1. The download address of PHP5 RC3 PHP is: http://www.php.net/downloads.php, find two packages in the download box. Among them, PHP 5.0.0RC3 Zip packages are PHP5 software packages, and Collection of PECL MODULES for PHP 5.0.0RC3 is a PHP5 PECL extension module set package. After the download is complete, put it on the C disk.

2. Apache

2.0.49

Apache official download address is: http://httpd.apache.org/download.cgi, find the following image, download for Windows MSI installation package, saved in the C disk. 3. MySQL

4.0.20

MySQL official download address is: http://dev.mysql.com/downloads/mysql/4.0.html, find the Windows Downloads section, download the WITHOUT Installer package and save it in the C drive, as shown below:

Installing PHP5 assumes that your system is installed in a C drive, otherwise the following directory must be changed to the directory of the corresponding disk. PHP5 RC3 (PHP-) will be downloaded

5.0.0

RC3-WIN32.ZIP) Unzip to C: / PHP5 / Directory. Unzip all files in the PECL extension module package to the C: / PHP5 / EXT / Directory. Copy the php5ts.dll file under the C: / PHP5 / directory to C: / Windows / (if it is a Windows 2000 operating system, it is a C: / WinNT / Directory, the same, no repeated instructions). Copy the following DLL files in the C: / PHP5 / directory in C: / Windows / System32 / Directory:

Fdftk.dllfribidi.dllgds32.dllibeay32.dllibintl-1.dllibmhash.dllibmysql.dllibmysqli.dllnTwdblibmysqli.dllnTwdblib.dllNTwdblib.dllyaz.dll

Where libMysql.dll is extended by MYSQL 4.1, libmysqli.dll is the extension support for the version of MySQL 4.1. Because I downloaded Mysql above.

4.0.20

Therefore, it can be replicated to replicate libmysql.dll. Copy the php.ini-dist file in the C: / PHP5 / directory to the C: / Windows / Directory, and renamed PHP.INI, and open the editor with Notepad: Nearly two lines:

Directory in which the loadable extensions (modules) reside.extension_dir = "./"

Modify the following line points to the C: / PHP5 / EXT / directory, then modified as follows:

Directory in which the loadable extensions (modules) reside.extension_dir = "c: / pHP5 / ext /" is positioned below:

Windows Extensions; Note That ODBC Support is Built IN, SO No DLL IS NEEDEDIT.

It can be seen that all of the following supporting extensions are listed below, we can remove the previous semicolons to support PHP support the corresponding extension. I tested it, support the following extensions, or you can configure it according to the selection.

extension = php_bz2.dllextension = php_cpdf.dllextension = php_curl.dllextension = php_dba.dll; extension = php_dbase.dllextension = php_dbx.dll; extension = php_exif.dllextension = php_fdf.dllextension = php_filepro.dllextension = php_gd2.dllextension = php_gettext.dll; extension = php_iconv.dll; extension = php_ifx.dllextension = php_iisfunc.dllextension = php_imap.dll; extension = php_interbase.dllextension = php_ldap.dllextension = php_mbstring.dll; extension = php_mcrypt.dllextension = php_mhash.dllextension = php_mime_magic.dllextension = php_ming. dll; extension = php_mssql.dll; extension = php_msql.dllextension = php_mysql.dll; extension = php_oci8.dllextension = php_openssl.dll; extension = php_oracle.dllextension = php_pdf.dll; extension = php_pgsql.dllextension = php_shmop.dllextension = php_snmp. dllextension = php_sockets.dll; extension = php_sybase_ct.dllextension = php_tidy.dll; extension = php_w32api.dllextension = php_xmlrpc.dllextension = php_xsl.dll; extension = php_yaz.dllextension = php_zip.dll

Save the file and exit.

Install Apache

2.0.49

Ready to download Apache_2.x.x-win32-x86-no_ssl.msi. Start the installation after double-click. One step next, agree to the license agreement, there will be a page that fills in the server information, local debugging, two input localhost. as follows:

All the way next, install the default path - Of course, you can also choose the path you need. Apache will automatically install and launch relevant services. And run an Apache monitor in the lower right corner of the task bar:

We can restart, stop, start Apache service from this monitor. Double-click the small icon to open the control interface:

Next, the Apache's configuration file is configured, and the C: / Program files / apache group / apache2 / conf / Apache group / apache2 / conf / (I am using the default installation path), and the back settings will be changed according to their own installation path) The httpd.conf file under the directory, positioned below: DirectoryIndex index.html index.html.var

Add a PHP default page later, usually index.php, as follows:

DirectoryIndex index.html index.html.var index.php

In order to enable Apache to identify PHP-related extensions, search and locate this section:

ALOWOVERRIDE NONE OPTIONS NONE ORDER ALLOW, DENY Allow from All

Add the following two lines later:

AddType Application / X-httpd-php .php .phtml .php3 .php4 addtype application / x-httpd-php-source .phps

Specify the PHP module and locate it to the following line:

#LoadModule SSL_Module Modules / Mod_ssl.so

Add a line below:

LoadModule PHP4_MODULE C: /PHP5/php5apache2.dll

Let it point to the php5apache2.dll file under the PHP5 directory, the path must be accurate. In order to specify Apache recognition Chinese, we specify that GB2312 is the default code. Should be found and positioned below this line

AddDefaultCharset ISO-8859-1

Modify it to:

AdddefaultCharset GB2312

Also, if you want to ban directory browsing, find and locate it below:

# ... # some comments # ...... Options Indexes Followsymlinks

Remove a few lines of INDEXES that follows the row below, modify:

# ... # some comments # ... Options Followsymlinks

OK, save the httpd.conf file and follow the Apache server. Install mysql

4.0.20

Compress MySQL-4.0.20-WIN-NOINSTALL.ZIP folder to the root directory of the C drive (note: Use this version of Mysql must put the decompression file folder in the root directory of the C drive), can decompress it can be in C Find a folder called MySQL-XXX under the root directory. The name is named mysql. Enter the bin directory, find the winmysqladmin.exe file, open it. The first run will prompt to enter a new username and password. Here you can choose the username and password input you need, as the default user name and password of My.ini. As shown below:

After clicking OK, WinMysqladmin will narrow down to the taskbar of the lower right corner:

Let's take a look at whether the mysql service is started. Open "Control Panel" and open "Management Tool" and open "Service". If everything goes well, we will see the information that mysql has started, as shown below: The installation of MySQL here is very simple. Test whether PHP is configured successfully: Open Notepad, enter the following line code:

>

Saved as a phpinfo.php file, stored in the apache2 / htdocs / directory, remember to save the type "All Files", as shown below:

Ok, open your browser, type in the address bar: http://localhost/phpinfo.php and Enter, if everything goes well, you will see the following page, to this PHP5 configuration is very good:

Note: This article does not discuss the configuration of the server from security and performance. For a corresponding security configuration, please refer to other manuals. This article briefly introduces the configuration of the PHP5 environment. As a premise of learning PHP5, this article cannot be read as a server configuration article. For example, there is no Mysql root user password here, which will lead to a large security hazard, so readers will be set up. About the Author

Deep Sky (Shenkong), studying the electronic information engineering of Xi'an University of Electronic Science and Technology, love PHP. Personal Homepage: www.openphp.cn, contact mail: kim@openphp.cn

转载请注明原文地址:https://www.9cbs.com/read-8584.html

New Post(0)