Apache + PHP +mysql installation configuration method summary

  • 2020-03-31 21:01:40
  • OfStack

The entire installation process is as follows:

1, first install apache: the version I installed is: httpd-2.2.16-win32-x86-openssl-0.9.8o.si
Website: http://www.apache.org/dist/httpd/binaries/win32/
Apache installation and configuration is relatively smooth, nothing to say.
Method to change the file path:
In the installation directory of the file, I am: D:\Program Files\Apache Software Foundation\Apache2.2\conf, open httpd.conf search: DocumentRoot "C:/web/ Apache /htdocs" to change the value to the publishing path you want, for example:
DocumentRoot "D: / WWW"
And then there's another one that needs to be fixed
Search: Directory "C:/web/apache/htdocs"
Change to: Directory "D:/WWW"
This changes the publication path of the file to d: WWW.

2. Install PHP: version: php-5.3.3-win32-vc6-x86

Website: http://windows.php.net/download/
Unzip the downloaded package into D: PHP and rename php.ini-development in this directory to php.ini
Open php.ini and modify it as follows:
Search: error_reporting = E_ALL
Change: error_reporting =E_ALL & ~E_NOTICE
Here is the modification error reporting level, E_ALL is reporting all errors, and E_NOTICE is reporting run-time attention messages, such as for initialized variables.
Search: extension_dir = "./"
Change: extension_dir = "D:\php5\ext" to configure the path to the extension library
Search:; Extension = php_mysql.dll, remove the previous semicolon: extension= php_mysql.dll
Search:; Extension = php_mysqli.dll remove the preceding semicolon: extension= php_mysqli.dll
Search; Session.save_path = "/ TMP", change to an existing path, session.save_path = "D:/mysql/session", or create a TMP folder in the publish directory.
PHP is basically set up

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 new text file named: httpd-php5.conf, open to add the following content
The 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"
Then open: C:\web\apache\conf\httpd.conf and add a line at the end of the file:
Include the conf/extra/HTTPD - php5. Conf
Restart Apache, open directory: D:\WWW, new file: index.php, input content:
< ? PHP
A phpinfo ();
? >
Use a browser to open http://localhost and test the installation
Step 4: install mysql: version mysql-5.1.49-win32
Website: http://dev.mysql.com/downloads/mysql/#downloads
After installation, there is a configuration wizard, not very strict according to which option to set, according to their own needs to set on the line, little impact.
Combined with Apache and PHP, as mentioned earlier, here again, in the PHP installation directory to find php.ini, "; The extension = php_mysql. DLL "before";" Remove and load the mysql module. Save, close, and restart apache.
Step 5: install phpMyAdmin
I in the download of hua jun software: http://www.onlinedown.net/soft/2616.htm
Unzip it into the release directory, which is previously set D:\WWW; Change config.default.php under the \libraries folder
Make the following modifications:
1 finds the password in the following two lines
The $CFG [' the Servers'] [$I] [' user '] = 'root';
The $CFG [' the Servers'] [$I] [' password '] = ' ';
Put your mysql password in $CFG ['Servers'][$I]['password'] = ''; Inside single quotation marks
2 search $CFG [' PmaAbsoluteUri], set it to phpMyAdmin directory path, such as: http://localhost/phpMyAdmin/
I don't know if the above method is necessary, because I later changed it back to work.

Summary of problems encountered during configuration:
One, the installation of mysql failed.
The general case is that the previous Mysql uninstall is not complete. How to uninstall mysql cleanly? In a DOS environment
1, first stop mysql services: stop mysql: net stop mysql, you can also right-click "my computer" - management - services - find mysql services, and then stop.
2. Uninstall c:\mysql\bin\mysqld-nt --remove under DOS
//c:\mysql\bin\ is the specific path. If you want to delete mysql completely, finish the mysql process and uninstall mysql.
Attached are two DOS instructions:
Mysql: net start Mysql
Installation: c:\mysql\bin\mysqld --install // note to modify the specific path
3. Delete the remaining mysql files directly.
If you accidentally delete all the files of mysql, and did not perform the above uninstall function, you can use the following method:
1, stop mysql service, same as 1 above.
2. Manually delete the registry information:
Clear your MYSQL service in the registry (regedit). There are several places :HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL directory delete; HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL directory delete; HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL directory delete;
As shown in figure:
< img border = 0 SRC = "http://files.jb51.net/upload/201008/20100801185616577.jpg" border = 0 >
Just restart.

Two, there is a problem when connecting to the database:

"Because the connection party did not reply correctly after a period of time or the connected host did not respond", I showed up when testing the mysql connection
 
 
[Ctrl+A]
The reason is that the mysql parsing error, because the hosts file is not defined, change the localhost to 127.0.0.1 to show normal, or under C:\Windows\System32\drivers\etc, modify the hosts file to add 127.0.0.1 localhost.
(link: http://xiazai.jb51.net/201008/books/php_bp.rar)

Related articles: