I have written so many PHP programs, I have never been paid by I have used it. I used to use three-in-one. I decided that I tried to configure it. It is the first time. Of course, I have to refer to the article of others, and configure it according to this method. In addition to the database unable to connect, other normal error prompts can't connect to mysql server on 'localhost' (10061) I took it for a long time to explore, found that there is a my_cnf.bak file under the C drive, haha is called MY.CNF The directory involved in Notebook is changed to E: / apache / mysql / ..., my mysql is under E: / Apache / MySQL, each according to his situation, I test, I found no matter Which my.cnf file is in the MYSQL file must be on the C. So after the first trial, there is a feeling of happiness! Simple installation configuration of Apache PHP5 MYSQL4 phpMyAdmin under Win2003
First, from Official websites, apache2.050, php5, mysql4.0.20, phpmyadmin2.57
Apache_2.0.50-win32-x86-no_ssl.msi php-5.0.0-win32.zip mysql-4.0.20d-win.zip phpMyadmin-2.5.7.zip
Operating system Win2003 system disk is: D disk
Step 1: Install Apache and configure support for PHP
Click the installation file Apache_2.0.50-win32-x86-no_ssl.msi Install apache in the D: / Apache2 directory (with your preference) to extract the contents in the PHP-5.0-win32.zip to D: / PHP to find PHP PHP.INI-DIST in the catalog is renamed PHP.INI and copy it to the Windows directory (Win2k in Winnt), such as my php.ini is copy to d: / windows directory, put PHP5Ts.dll in the PHP directory, Libmysql.dll is copied to the system catalog (System / System32), if you are D: / Windows / System
Configuring httpd.conf in apache to open d: /apache2/conf/httpd.conf This file is found to change it to AddDefaultCharset GB2312 (let the default language code to Simplified Chinese) find DocumentRoot "D: / Apache2 / HTDOCS "change it to your web directory (can not change), as my DocumentRoot" D: / Website "found DirectoryIndex index.html index.html.var Add index.htm index.php
Select Installation Mode: Modular mode installation or CGI mode installation (optionally)
-------------- Modular installation configuration ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---- Find #LoadModule SSL_Module Modules / MOD_SSL.SO this line, add a line loadModule php5_module d: /php/php5apache2.dll after this line where d: /php/php5apache2.dll is in your php5apache2.dll Location of AddType Application / X-gzip .gz .tgz, add a line of addtype application / x-httpd-php .php after this line ------------------------------------------------------------------------------------------------------------ -------------------------------------------------- --------- CGI installation configuration ------------------------------------ Locate AddType Application / X-Gzip .gz .tgz, join the following scriptalias / php / "d: / php /" addtype application / x-httpd-php .php action application / x-httpd-php "/ PHP / php-cgi.exe "----------------------------------------- --------------------
At this point, the PHP environment is basically configured to build a file content called Test.php in the web root directory (such as my D: / Website).
Restart Apache service Browser Open http: //localhost/test.php If you can see the PHP configuration output information is OK
Second step to install MySQL
Install MySQL to the specified directory. If you are D: / mysql, if you download is the non-installed MySQL compression package, you can download it directly to the specified directory and then click D: /Mysql/bin/winmysqladmin.exe this file where D: / MySQL is your MySQL installation directory Entering Winmysqladmin initial user, password (Note: This is not MySQL user, password) Just fill no need to determine the launch bar of your lower right corner task, there will be a traffic light icon, red light Light representative service stop, green light is normal, turn left this icon -> Winnt-> Install the service Install this service to click this icon -> Winnt-> Start The Service Launom Mysql Service
Modify the ROOT password of the mysql database Use the CMD to enter the life. This row mode input is as follows: (Note: D: / mysql is mysql installation directory) CD D: / mysql / bin mysqladmin -u root -p password 123456 Enter ENTER Password: (Note: This is called you to enter the original password. When you just install it, your password is empty, so you can use it directly) At this time, the password of the account root in MySQL is changed to 123456 installation.
Third, configure php.ini and test mysql (php.ini is pHP.ini under Windows)
Found extension_dir = "./" changed to extension_dir = "d: / php / ext" found; extension = php_mysql.dll will ';' remove it to extension = php_mysql.dll; session.save_path = "/ tmp" De dropping the directory of setting you to save the session, such as session.save_path = "d: / php / session_temp"; restart the Apache service under the web root directory (such as D: / Website) Established TestDb.php file content as follows: $ link = MySQL_Connect ('localhost', 'root', '123456'); if (! $ link) echo "fail"; Else Echo "Success"; mysql_close ();>> Open http: // localhost / testdb with a browser. PHP if it outputs Success is OK
Fourth, PHPMYADMIN installation configuration
Unzip phpMyadmin-2.5.7.zip to the web root directory, rename folders to pHPMYADMIN or other CONFIG.INC.PHP in the phpMyadmin directory to find $ CFG ['Servers'] [$ I] ['user' ] = 'root'; $ cfg ['servers'] [$ I] ['password'] = '123456'; fill in your MySQL user and password, respectively
If it is not used locally, it is best to add verification