Configure IIS5.0 + PHP5.23 + MYSQL5 + phpMyAdmin_MySQL in the PHP environment

Source: Internet
Author: User
Tags echo date blank page
Configure IIS5.0 + PHP5.23 + MYSQL5 + phpMyAdmin phpmyadmin in the PHP environment

I. Install PHP5

1. get PHP

Open the PHP official website download page: http://www.php.net/downloads.php

Select "PHP 5.2.3 installer [21,966 Kb]-01 June 2007" to download

Download PHP 5.2.3 zip package

2. PHP5 installation process

PHP 5.2.3 installer unzip to D:/PHP for installation

PHP 5.2.3 zip package decompress it to D:/temp, and copy the ext folder and php_mysql.dll to the PHP installation root directory D:/PHP.

3. configure PHP

After installing PHP, you cannot use IIS to explain the PHP file. you need to configure

Open IIS, right-click the "default site" attribute, and select "configuration" in the "main directory" category"

Click the Add button to map the application extension. the executable file is php5isapi. dll under the installed PHP directory, and the extension is. php.

4. Debug PHP

Create a folder in the local disk directory for PHP debugging, and quickly set the virtual path of the folder to php

Open Dreamweaver and enter code

Phpinfo ();
?>


Save the file in a defined folder, and enter the file name index. php to be saved.

Open IIS and debug the php file http: // localhost/php/index. php

5. configure php. ini

PHP5 does not support MSQL by default, so we need to configure PHP. INC.

(1) set the extension path
Find the row in extension_dir
; Extension_dir = "./"
Add a line after this line (note that adding a line is not followed)
Extension_dir = "d:/php/ext"

D:/php is the path for installing php. Dll cannot be loaded if the path is incorrect.

(2) search for extension

Extension = php_mbstring.dll
Extension = php_gd2.dll
Extension = php_mysql.dl

Remove the semicolon before the preceding three items so that these dll files can be loaded when IIS is started.


2. install MYSQL

MYSQL installation is basically a one-way "NEXT" and below is OK

3. install and configure Phpmyadmin

PhpMyAdmin (PMA for short) is written in PHP and can be used to control and operate MySQL online over the Internet. It is the preferred database maintenance tool for many MySQL administrators and website administrators. you can use phpMyAdmin to operate the MySQL database completely.

1. download phpMyAdmin

Open phpMyAdmin official site: http://www.phpmyadmin.net/, select "Download" on the page, the latest version is phpMyAdmin 2.11.0-rc2, select “all-languages.zip file Download

The downloaded ZIP file is decompressed by the decompression software. the downloaded ZIP file is decompressed by the decompression software on the local disk D:/phpmyadmin. at the same time, you can quickly set the virtual path of this folder to phpmyadmin.

2. phpMyAdmin installation

Of course, you must configure the following files to use phpMyAdmin normally, whether you are testing locally or on a remote server.

First, there is a file "config. sample. inc. php ", this is a sample file of the phpMyAdmin configuration file. we need to copy all the code in this file and create a new file" config. inc. php, and paste the code. The config. inc. php file is the configuration file of phpMyAdmin, which must be uploaded to the server.

Note: You need to add blowfish_secret to define the Cookie and find the code line:

$ Cfg ['blowfish _ secret'] = '';


Set content to COOKIE


$ Cfg ['blowfish _ secret'] = 'webjxcom ';


Test URL: http: // localhost/phpmyadmin/

FAQ 1: phpMyAdmin "mysql extension cannot be loaded. check the PHP configuration"

Solution:

1 Open the http://www.php.net/downloads.php select "PHP 5.2.3 zip package" zip package file, and extract all the ext folders to the PHP installation directory, so there is extension_dir = "D: /PHP/ext/"(note: The premise is that your PHP is installed on the D drive)

2. copy php_mysql.dll in PHP 5.2.3 zip package to the PHP installation root directory. we recommend that you restart IIS and debug phpMyAdmin.

3. configure php. ini

PHP5 does not support MSQL by default, so we need to configure PHP. INC.

(1) set the extension path
Find the row in extension_dir
; Extension_dir = "./"
Add a line after this line (note that adding a line is not followed)
Extension_dir = "d:/php/ext"

D:/php is the path for installing php. Dll cannot be loaded if the path is incorrect.

(2) search for extension

Extension = php_mbstring.dll
Extension = php_gd2.dll
Extension = php_mysql.dl

Remove the semicolon before the preceding three items so that these dll files can be loaded when IIS is started.


(3) set the session storage path
Find the row in session. save_path.
; Session. save_path = "N;/path"
Add a line after this line
Session. save_path = "C:/WINDOWS/Temp"

Save it to your temporary directory, which can be saved to the windows temporary directory Temp.

(4) it is worth noting that short_open_tag is Off by default.
That is to say, php cannot use short tags such Required
Short tags are easy to use, and many programs use short tags for writing, such as discuz.
If you do not change short_open_tag to On, it will be difficult to determine the cause. we recommend that you modify it here.

Search
Short_open_tag = Off
Change
Short_open_tag = On

(5) whether the error display_errors is displayed
For security reasons, display_errors is also Off by default.
That is to say, when debugging, if the php code is incorrect, only one blank page is displayed. The error cause and number of lines are not displayed.
Therefore, debugging is inconvenient. you are advised to modify it as needed.
Search
Register_globals = Off
Change
Register_globals = On

(6) register_globals
It is also Off by default for security reasons.
When register_globals = Off, $ _ POST ['User _ name'] and $ _ POST ['User _ pass'] should be used for receiving the next program.
When register_globals = On, the next program can directly use $ user_name and $ user_pass to accept the value.

We recommend that you modify the settings as needed.

(7) php5 time difference
Time difference: eight hours
Why? The time zone settings are added for the PHP5 series. the default value is Greenwich Mean Time, which is 8 hours different from the East 8 zone in China.
Find the row in date. timezone
; Date. timezone =
Replace;
Date. timezone = PRC

PRC: People's Republic of China

FAQ 2: Access denied for user 'root' @ 'dbhost' (using password: NO)

Solution:

Save the unmodified config. sample. inc. php in The Phpmyadmin root directory as config. inc. php and restart IIS.

For the config. inc. php file, the most important thing is to modify the username and password used by phpMyAdmin to connect to MySQL. Find the code line:

// $ Cfg ['servers'] [$ I] ['controluser'] = 'PMA ';
// $ Cfg ['servers'] [$ I] ['controlpass'] = 'pmapass ';


Delete the "//" comment and enter the username and password configured in MySQL (contact your space service provider for remote servers). For example:


$ Cfg ['servers'] [$ I] ['controluser'] = 'webjxcom ';
$ Cfg ['servers'] [$ I] ['controlpass'] = '*********';


Note: You need to add blowfish_secret to define the Cookie and find the code line:

$ Cfg ['blowfish _ secret'] = '';


Set content to COOKIE

$ Cfg ['blowfish _ secret'] = 'webjxcom ';

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.