Summary of installation and configuration methods for Apache + PHP + MySql

Source: Internet
Author: User
Tags tmp folder

The installation process is as follows:

1, first install Apache: My installed version is: httpd-2.2.16-win32-x86-openssl-0.9.8o.msi
The installation and configuration of Apache are smooth.
How to change the file path:
Under the installation directory of the file, my files are: D: \ Program Files \ Apache Software Foundation \ apache2.2 \ conf, and httpd is enabled. conf search: DocumentRoot "C:/web/Apache/htdocs" to change the value to the desired release path, for example:
DocumentRoot "D:/www"
There is another one that needs to be modified.
Search: directory "C:/web/Apache/htdocs"
Change to directory "D:/www"
In this way, the file publishing path is changed to D: www.

2, install PHP: Version: php-5.3.3-Win32-VC6-x86

Decompress the downloaded package to D: PHP, and rename PHP. ini-development under the directory to PhP. ini.
Open PHP. ini and modify it as follows:
Search: error_reporting = e_all
Modify: error_reporting = e_all &~ E_notice
Here, the error report level is changed. e_all is the report of all errors, and e_notice is the message to be noticed during the report runtime, such as the initialization variable.
Search: extension_dir = "./"
Modify extension_dir = "D: \ PhP5 \ Ext" to configure the extension library path.
Search:; Extension = php_mysql.dll, remove the semicolon: Extension = php_mysql.dll
Search:; Extension = php_mysqli.dll remove the semicolon: Extension = php_mysqli.dll
Search; Session. save_path = "/tmp", changed to an existing path, session. save_path = "D:/MySQL/session", or create a tmp folder under the release directory.
PHP Basic settings complete

3. Configure Apache to load PHP

Open the installation directory of apachede, my is: D: \ Program Files \ Apache Software Foundation \ apache2.2 \ conf \ extra, create a text file named: httpd-php5.conf, open Add the following content
View sourceprint? Loadmodule php5_module "C: \ WEB \ PHP \ php5apache2_2.dll"
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP-source. PHPs
Directoryindex index. php
Phpinidir "C: \ WEB \ PHP"
Open c: \ WEB \ apache \ conf \ httpd. conf and add a line at the end of the file:
Include CONF/extra/httpd-php5.conf
Restart Apache, Open Directory: D: \ www, Create File: index. php, input content:
<? PHP
Phpinfo ();
Open http: // localhost in the browser and test whether the installation is successful.
Step 4: Install MYSQL: Version mysql-5.1.49-win32
There is a Configuration Wizard after installation, which does not strictly follow which option to set, just set according to your needs, the impact is not big.
It is used in combination with Apache and PHP, as mentioned earlier. Here we will talk about how to find PHP in the PHP installation directory. INI, remove ";" before "; Extension = php_mysql.dll", and load the MySQL module. Save and shut down. Restart Apache.
Step 5: Install phpMyAdmin
Http:// I downloaded from huajun Software
Decompress the package to the release Directory, which is the previously set D: \ www; change config. Default. php In the \ libraries folder.
Make the following changes:
1. There are two rows for searching for the password:
$ Cfg ['servers'] [$ I] ['user'] = 'root ';
$ Cfg ['servers'] [$ I] ['Password'] = '';
Enter your MySQL password in $ cfg ['servers'] [$ I] ['Password'] = ''.
2. Search for $ cfg ['pmaabsoluteuri '] and set it to the phpMyAdmin directory path, for example, http: // localhost/PHPmyAdmin/
The above practice does not know if it is necessary, because it can also be run after I change it back.

Summary of problems encountered during the configuration process:
1. MySQL Installation failed.
generally, the previous MySQL uninstallation is incomplete. How can I clean and uninstall MySQL? In the DOS environment
1, stop MySQL service: Stop MYSQL: net stop MySQL, or right-click "my computer"> Manage> service> Find MySQL service, then stop.
2. Uninstall c: \ mysql \ bin \ mysqld-NT -- remove under DOS
/c: \ mysql \ bin \ is the specific path, to completely delete MySQL, end the MySQL process and then uninstall MySQL.
two DOS commands are attached:
Start MYSQL: Net start mysql
Installation: C: \ mysql \ bin \ mysqld -- install // modify the specific path
3. Delete the residual MySQL file directly.
If you accidentally delete all MySQL files and have not previously executed the unmount function, you can use the following method:
1. Stop the MySQL service, same as above 1.
2. manually delete the Registry Information:
clear your MySQL service in the Registry (Regedit. There are several points: HKEY_LOCAL_MACHINE \ SYSTEM \ controlset001 \ Services \ Eventlog \ Application \ mysql directory deletion; HKEY_LOCAL_MACHINE \ SYSTEM \ controlset002 \ Services \ Eventlog \ Application \ mysql directory deletion; HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ Eventlog \ Application \ mysql directory deletion;

2. database connection problems:

"Because the connection fails to respond correctly after a period of time or the connected host does not respond", I showed up when testing the MySQL connection.<? PHP header ("Content-Type: text/html; charset = UTF-8"); <br/> $ link = mysql_connect ("localhost", root, 605959 ); <br/> If (! $ Link) echo "failed! "; <Br/> else echo" successful! "; <Br/> mysql_close (); <br/>?>
[Ctrl + A select all Note: If you need to introduce external JS, You need to refresh it to execute]

The reason is that the MySQL parsing error occurs because the hosts file is not defined. If localhost is changed to, it is displayed as normal, or under c: \ windows \ system32 \ drivers \ etc, modify the hosts file, add localhost.
PHP configuration environment (standard configuration) for word

Related Article

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: 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.