Summary of installation and configuration methods for apache + php + mysql

Source: Internet
Author: User
Tags tmp folder
I used to develop a PHP project using the integrated software package of the PHPXAMPP software station. I don't know that there will be so many problems when I install each module separately. this time I spent most of my time building the environment. Apache

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
Web: http://www.apache.org/dist/httpd/binaries/win32/
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

Web: http://windows.php.net/download/
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:
Phpinfo ();
?>
Open http: // localhost in the browser and test whether the installation is successful.
Step 4: install mysql: version mysql-5.1.49-win32
Web: http://dev.mysql.com/downloads/mysql/#downloads
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://www.onlinedown.net/soft/2616.htm 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 configuration:
1. failed to install mysql.
Generally, the previous Mysql uninstallation is incomplete. How can I clean and uninstall mysql? In a DOS environment
1. stop the mysql service first: stop Mysql: net stop mysql, or right-click "My Computer"> "manage"> "service" to find the mysql service and then stop it.
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.
The following two DOS commands are attached:
Start Mysql: net start mysql
Install: c: \ mysql \ bin \ mysqld -- install // modify the specific path
3. delete the residual mysql files directly.
If you accidentally delete all mysql files and have not previously executed the above uninstall function, you can use the following method:
1. stop the mysql service.
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;


Restart.

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"); $ link = mysql_connect ("localhost", root, 605959); if (! $ Link) echo "failed! "; Else echo" successful! "; Mysql_close ();?>
[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 127.0.0.1, it is displayed as normal, or under C: \ Windows \ System32 \ drivers \ etc, modify the hosts file, add 127.0.0.1 localhost.
PHP configuration environment (standard configuration) for word

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.