Configure the latest PHP and MySQL Server

Source: Internet
Author: User
Tags mysql functions

The latest PHP 5.0 + MySQL 5.0 + win2003.
I personally think it is necessary to write a tutorial because many aspects are different from those of the old version.
To be honest, I also read many official documents to solve many strange problems.

======================================

You can download related software from www. skycn. net.

MySQL 5.0 for Windows
PHP 5.0 for Windows
PhpMyAdmin
Windows Server 2003

======================================

First install mysql. I thought the installation interface of the new version should be fancy.
But I still only see the old Earth dolphins. Apart from the installation time being longer than 4.0. Of course, because 5.0 is much larger than 4.0.

We recommend that you install it on an independent NTFS partition. For example, you can only store the software on the F disk of my server.
Path: F: \ mysql \

Then enter F: \ mysql \ bin \ double-click winmysqladmin.exe
The first running will prompt you to enter the superuser and password. Then enter the root password.
NOTE: If it is an external server, set it to super complex. For example, wjwsfjn29szjwh ~ MySQL
My name is Wei Shufen. I am 29 years old and unmarried.

Here, MySQL installation is complete. If you do not understand, please refer to the relatedArticle.

======================================

In the following example, PHP 5.0 is installed without installation. Unzip the file. It is recommended
Path: F: \ PHP \

The key steps should be taken here.
First, copy the php. ini-Dist in the PHP Directory to c: \ windows \ and change the file name to PhP. ini.

Copy F: \ PHP. ini-Dist C: \ WINDOWS
Ren PHP. ini-Dist PHP. ini

For Windows 2000, c: \ winnt \
If it is Win9x/2003, it is c: \ windows \

Copy all the files in the DLLs directory under the PHP Directory to the System32 directory.

Copy F: \ PHP \ DLLs \ *. * c: \ windows \ system32 \

For Windows 2000, c: \ winnt \ system32 \
If it is Win9x/2003, c: \ windows \ system32 \

Continue. Copy the php4ts. dll file in the PHP Directory to the System32 directory.

Copy F: \ PHP \ php4ts. dll c: \ windows \ system32 \

======================================

The copy operation is complete here. Modify the c: \ windows \ PHP. ini file below.

Note: Version 5.0 and Version 4.0 are not exactly the same. Note the following.

Search for the extension_dir string. modify it to the extensions path in your PHP Directory.

; Directory in which the loadable extensions (modules) reside.
Extension_dir = F: \ PHP \ extensions

Related officialTechnical materials:

Edit your php. ini file:

You will need to change the 'extension _ dir' setting
Point to your PHP-install-Dir, or where you have placed
Your 'php _ *. dll 'files. Ex: C: \ PHP

If you are using OmniHTTPd, do not follow the next step.
Set the 'doc _ root' to point to your webservers
Document_root. Ex: C: \ apache \ htdocs or c: \ webroot

Choose which extensions you wowould like to load when PHP
Starts, noting that several extensions are already built
Into the Windows release, see the section about
Windows extensions for details of the built-in extensions.
You can uncomment The: 'extension = PHP _ *. dll 'lines
In PHP. ini to load these extensions.

Note that on a new installation it is advisable to first get
PHP working and tested without any extensions before enabling
Them in PHP. ini.

On PWS and IIS, you can set the browscap. ini
To point to: 'C: \ WINDOWS \ SYSTEM \ inetsrv \ browscap. ini 'on
Windows 9x/Me And 'C: \ winnt \ system32 \ inetsrv \ browscap. ini'
On NT/2000/XP Server.

More information on the capabilities of browscap can be found here:

Www.php.net/manual/en/function.get-browser.php

Note that the mibs directory supplied with the Windows distribution
Contains support files for SNMP. This directory shocould be moved
Drive: \ USR \ mibs (drive being the drive where PHP is installed .)

What is different from PhP 4.0 is that you need to modify the following content in the PHP. ini file:
Search for the CGI. force_redirect string. The default value is 1. Change it to 0. and cancel the previous; number.

That is:

; CGI. force_redirect is necessary to provide security running php as a CGI under
; Most Web servers. left undefined, PHP turns this on by default. You can
; Turn it off here at your own risk
; ** You can safely turn this off for IIS, in fact, you must .**
CGI. force_redirect = 0

Remember the above modification. Otherwise, PHP 5.0 cannot run. The following prompt will be displayed.

Security alert! The php cgi cannot be accessed directly.

Official Technical materials:

! Note! : Since 4.1.2, the php. ini setting CGI. force_redirect defaults to '1'
Which extends tively prevents the CGI from working within IIS. You need to set
Up at least a minimal PHP. ini file with the following Directive:

CGI. force_redirect = 0

If it doesn't work immidiately, make sure you have the php. ini file in
Right place (% SystemRoot % \ PHP. INI ).

Next, modify the settings of MySQL 5.0 in the PHP. ini file.

Find the content in the [MySQL] field. Modify as follows.

MySQL. default_port = 3306
// Here is the MySQL port.

MySQL. default_host = localhost
// Here is the local host.

MySQL. default_user = root
// Here is the user

MySQL. default_password = wjwsfjn29szjwh ~ MySQL
// Here is the password

After modification, You can associate PHP with MySQL.
Finally, start PHP to support the MySQL module.

Search for the extension = php_mysql.dll string. Delete the previous string; No.

Extension = php_mysql.dll

Please note. If you do not start PHP to support the MySQL module, phpMyAdmin will not work properly. The following prompt will be displayed:

Cannot load MySQL extension, please check PHP configuration
Unable to mount MySQL extension. Please check the PHP configuration.

Official Technical materials:

To connect to a MySQL server, PHP needs a set of MySQL functions called "MySQL extension ".
This extension may be part of the PHP distribution (Compiled-in), otherwise it needs to be loaded dynamically.
Its name is probably mysql. So or php_mysql.dll. phpMyAdmin tried to load the extension but failed.

======================================

There should be no major problems here. If you have a basic configuration, you can fully understand it.
I also encountered many problems during actual configuration. Finally, I patiently found the official documents and solved them.

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.