Configuration of PHP5 and Apache servers in a Windows environment

zhaozj2021-02-16  86

Author: deep space. Home: http://www.openphp.cn

The following article will tell Windows2000 / XP / 2003 (not recommended to establish a PHP environment under Windows 98), the server selects Apache 2.0.49, the database selection mysql version 4.0.20. Need to download a few packages: 1. PHP5 RC3 2. Apache 2.0.49 3. MySQL 4.0.20 Download Package: 1. PHP5 RC3 PHP download address is: http://www.php.net/downloads.php , Find the two packages in the following image, download two packages in the 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 graph position, download the for Windows MSI installation package, saved in the C disc.

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:

Install PHP5: Suppose your system is installed in the C drive, otherwise the following directory must be changed to the directory of the corresponding disk. Unzip the downloaded PHP5 RC3 (PHP-5.0.0.0RC3-WIN32.ZIP) to the 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:

Code

Fdftk.dll fribidi.dll gds32.dll libeay32.dll libintl-1.dll libmhash.dll libmysql.dll libmysqli.dll ntwdblib.dll ntwdblib.dll Yaz.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 4.0.20 above, it is actually replicating 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:

Code

Directory in which the loading extensions (modules) reside. Extension_dir = "./"

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

Code

Directory in which the loadable extensions (modules) reside. EXTENSION_DIR = "C: / PHP5 / EXT /" is positioned below:

Code

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.

Code

extension = php_bz2.dll extension = php_cpdf.dll extension = php_curl.dll extension = php_dba.dll; extension = php_dbase.dll extension = php_dbx.dll; extension = php_exif.dll extension = php_fdf.dll extension = php_filepro.dll extension = php_gd2 .dll extension = php_gettext.dll; extension = php_iconv.dll; extension = php_ifx.dll extension = php_iisfunc.dll extension = php_imap.dll; extension = php_interbase.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_mysql.dll; extension = php_oci8.dll extension = php_openssl.dll; extension = php_oracle.dll extension = php_pdf.dll; extension = php_pgsql.dll extension = php_shmop.dll extension = php_snmp.dll extension = php_sockets.dll; extension = php_sybase_ct.dll extension = php_tidy.dll; extension = php_w32api.dll extension = php_xmlrpc.dll extension = PHP_XSL.DLL; EXTENSION = php_yaz.dll extension = php_zip.dll

Save file exits 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 taskbar: We can restart, stop, start Apache service from this monitor. Double-click the small icon to open the control interface: Next to configure the Apache's configuration file, open the c: / program files / apache group / apache2 / conf / Apache group / apache2 / conf / (I am using the default installation path installation, follow yourself Install the path to the corresponding change) The httpd.conf file under the directory, locate it below: Code

DirectoryIndex index.html index.html.var

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

Code

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

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

Code

ALLOWOVERRIDE NONE OPTIONS NONE ORDER ALOW, DENY Allow from ALL

Add the following two lines later:

Code

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:

Code

#LoadModule SSL_Module Modules / Mod_ssl.so

Add a line below:

Code

LoadModule PHP5_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

Code

AddDefaultCharset ISO-8859-1

Modify it to:

Code

AdddefaultCharset GB2312

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

Code

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

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

Code

# ... # Some comments # ... Options Followsymlinks

OK, save the httpd.conf file and follow the Apache server. MYSQL 4.0.20 installation will 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 C-drive root directory), After decompression, you can find a folder named mysql-xxx in the C-drive 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 is determined, WinMysqladmin will narrow down to the task bar in 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:

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 the browser, enter: http: // localhost / phpinfo.php and carriage return, if everything goes well, you will see the following page, to this PHP5 configuration is highly referred to: Note: This article does not discuss the configuration of the server from security and performance, 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, which will lead to a lot of safety hazards, so please readers themselves Set. (Applause.) Deep Space Monkey Dragon Boat Festival in early Author: deep space. Home: http://www.openphp.cn

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

New Post(0)