Finishing: Quick installation of apache+mysql+php

Source: Internet
Author: User
Tags command line install php ini join mysql mysql client new features root directory

Although a lot of online, or here to record their own installation process, and some experience, do not have to install and then everywhere to find.

First say MySQL, because he can say completely independent and Apache, PHP installation is not directly related. Now MySql5.0 has been officially released, a number of new features, the database has a basic functionality already has, such as views, subqueries, stored procedures and so on. (MySQL official website for http://www.mysql.com, I think this should everyone should not know it ^ ^, find download Download a setup program.) ), click on the installation program, according to his one step choice, set good parameters. Smoothly installed on it, the new version of the installation process has been greatly improved, has even been registered service, the previous version is only to help you copy the program file, here by the way the previous installation services: In the operation of the input C:\mysql\bin\mysqld-nt.exe- Install. (C:\mysql\j is the path to the MySQL installation.) No problem installed, command line input: net start MySQL start service can be.

If the previous version is Mysql4.1, all programs will not be able to connect to MySQL for the following reasons:

Client does not support authentication protocol problem resolution when mysql4.1 above version connection

shell> MySQL

Client does not support Authenticationprotocol requested

by server; Consider upgrading MySQL client

The official version of the statement: MySQL 4.1 and up uses a authenticationprotocol based on a password hashing of that are algorithm with that Used by older clients. .....

If you are experiencing the above problems after you upgrade MySQL to version 4.1, make sure your mysqlclient is 4.1 or later. (If there is a problem with windows, you can just skip to the solution below, because MySQL is installed with Windows client and server)

Please use one of the following two methods

One

Mysql> SET PASSWORD for

-> ' some_user ' @ ' some_host ' =old_password (' newpwd ');

Second:

mysql> UPDATE mysql.user SET Password =old_password (' newpwd ')

-> WHERE Host = ' some_host ' and User = ' some_user ';

mysql> FLUSH privileges;

The red section above please revise according to oneself actual situation ....

When you do this, the connection will be normal!

Now the version has a very clear configuration file, as if the location is not very sure and very few people use, now very good in the MySQL root directory of the My.ini option is also rich. Related to see for themselves, stating that a datadir= "E:/document/data" This is the data directory, so you can move to other places.

This is the end of MySQL.

Now start to install Apache, open the installer, set your own parameters, the port defaults to 80, if the port has been changed to another such as 8080. Installation complete. Apache can be used, do have to do some other settings, you can open IE input http://localhost:80 try it if the page is properly described as successful installation.

Now install PHP, the file is unpacked to C:\php or your own directory, first of all, please C:\Php\Dlls directory in all the DLL files (PHP5 No this directory to the directory of all DLLs, of course, a bit is not to know the words to remove. Copy to the Windows System directory (%Windir%\System), where special attention is paid to%windir%\system here refers to the system variables, General win 98 is C:\windows/system, 2000/xp/ 2003 is C:\Windows (Winnt) \system32. But there are special circumstances, I used to have an XP installation but copy to the System32 is not to be in the system can be, at present do not know why, for everyone to mention a wake up. Copy C:\Php\Php.ini-recommended, Php4ts.dll (Php5ts.dll) to the Windows directory (%windir%), rename it to PHP.ini, and open it with a text editor. Edit the 3 lines that are set up for Extension_dir and Session.save_path to match the one shown below, and note that the INSTALLDIR is replaced with the name of your Apache installation directory.

Extension_dir = c:\php\extensions (PHP extended dynamic Link file)

Session.save_path = C:/temp (fill in a directory yourself)

The rest is set according to your own needs.

Add PHP Related Settings

Find directoryindexindex.html Index.html.var plus index.php, you can add the index page you want, such as login.php,default.php.

Found it

AddType application/x-compress. Z

AddType application/x-gzip. GZ tgz

Join

AddType application/x-httpd-php. php

AddType Application/x-httpd-php-source.phps (. Phps is the file that displays the code)

AddType Image/x-icon. ico

Found it

#LoadModule usertrack_modulemodules/mod_usertrack.so

#LoadModule vhost_alias_modulemodules/mod_vhost_alias.so

#LoadModule Ssl_module modules/mod_ssl.so

Join

LoadModule Php4_modulec:\php\sapi\php4apache2.dll

(Php5:loadmodule php5_module C:\php\php5apache2.dll)

If you need to run a PHP program in CGI mode for some reason (using Php.exe), turn the line above into a comment and add the following lines to the httpd.conf:

scrīptalias/php/"c:/php/"

Action application/x-httpd-php "/php/php.exe"

This will support PHP, and here are some of the relevant settings

Listen 80

This is the port setting

DocumentRoot "e:/database/php"

This is the directory of the document

Adddefaultcharset ISO-2022-CN (gb2312)

Set the default code here, this is set to Chinese, if you find that your page is garbled will set this up

This completes all of the installation work, you can try, do not forget to restart the Apache.



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