Apache+php+mysql Operating Environment

Source: Internet
Author: User

Suggested apache2.4+php5.6+mysql5.5+phpmyadmin4.4.4

Reference: http://jingyan.baidu.com/article/fcb5aff797ec41edaa4a71c4.html; http://jingyan.baidu.com/article/ 4dc408488ecb82c8d946f1dc.html

1. apache2.4, download link: http://www.apachelounge.com/download/

It is also recommended for v11,64 bit.

2. Unzip the downloaded Apache archive and copy it to d:\Apache24\.

3. Modify the D:\Apache24\conf\httpd.conf.

Change the ServerRoot line to ServerRoot "D:/apache24", where your Apache is placed between the double quotes

4. Modify the D:\Apache24\conf\httpd.conf.

Modify the DocumentRoot as follows:

DocumentRoot "D:/apache24/htdocs"

<directory "D:/apache24/htdocs" >

5. The serveradmin of the No. 204 line does not change;

Line NO. 213 servername The "#" in front of the number to remove;

No. 237 line DocumentRoot "C:/apache24/htdocs" to DocumentRoot "D:/apache24/htdocs";//web site root directory

Line No. 238 <directory "C:/apache24/htdocs" > Changed to <directory "D:/apache24/htdocs" >;

Line No. 271 DirectoryIndex index.html Change to DirectoryIndex index.html index.php index.htm//Support more default pages

Line No. 354 scriptalias/cgi-bin/"c:/apache24/cgi-bin/" instead of scriptalias/cgi-bin/"d:/apache24/cgi-bin/"

Line No. 370 <directory "C:/apache24/cgi-bin" > Changed to <directory "D:/apache24/cgi-bin" >

6. Execute d:\apache24\bin\httpd.exe-k install to add Apache to the system service and manually open Apache in the service (if you want to uninstall this service, first stop this service, then enter HTTPD.EXE-K Uninstall-n "ServiceName" uninstall this service. ServiceName is the name of the service and can be customized. )

7. Configure PHP to support Apache: (Copy all DLL files within the PHP5 (including the DLL files in the Ext folder) to the System32 folder of the WINDOWS system, such as C:windows\system32. This step is for the Windows system to get the DLL files that are running PHP, the meaning of the same as the specified system environment variables, just for the sake of simplicity, and copy the DLL files directly to the Windows system directory. If your system is 64-bit, copy the 32-bit DLL file to the C:\Windows\SysWOW64 directory)

http://windows.php.net/download/#php-5.5 Download Php5.5vc11 x64 Thread safe version, add;D in the System environment variable path: \php;d:\php\ext, takes effect after reboot. Unzip the PHP file package into the D directory named PHP into the PHP folder to find the following 2 files under either backup renamed to PHP.ini {set Date.timezone =PRC; set extension_dir = "D:/php/ext"; set max _execution_time = 0 for the run timeout never expires and open PHP common several extensions, the extension file into the Ext folder; in Apache conf add the following lines to increase support for PHP5:

# PHP5 Support

LoadModule Php5_module D:/php/php5apache2_4.dll

AddType application/x-httpd-php. php. html. htm (set PHP file parsing)

# Configure the path to PHP.ini

Phpinidir "d:/php"

Copy the modified php.ini file and paste it into the C:\Windows or import the PHP folder Ssleay32.dll and Libeay32.dll no longer copy it to the C-drive Windows directory ()

Finally, the phpinfo () function can be used to test whether the Php+apache is connected

8. Install MySQL manually (download mysqlcommunity Server 5.6.13------http://dev.mysql.com/downloads/mysql/ Download Windows (x86, 64-bit), ZIP Archive version or Baidu Cloud https://pan.baidu.com/share/link?shareid=2303223802 HYPERLINK "https://pan.baidu.com/share/link?shareid=2303223802&uk=3029771834" & HYPERLINK "https:// pan.baidu.com/share/link?shareid=2303223802&uk=3029771834 "uk=3029771834 Download extract code w60l)

http://blog.csdn.net/q98842674/article/details/12094777 (Reference)

Configure or create a new My.ini file {

[Client]
port=3306
Default-character-set=utf8
[Mysqld]
port=3306
Character_set_server=utf8
Basedir=d:\program Files\mysql\mysql-5.6.13-win32
#解压目录
Datadir=d:\program Files\mysql\mysql-5.6.13-win32\data
#解压目录下data目录 (This step can be skipped)
Sql_mode=no_engine_substitution,strict_trans_tables
[Winmysqladmin]
D:\Program Files\mysql\mysql-5.6.13-win32\bin\mysqld.exe

}

Right-click Environment variables, properties---Advanced system settings (Advanced), My Computer
Click the New button under System variables
Input variable name: mysql_home
Input variable Value: D:\mysql
#即为mysql的自定义解压目录

Find path--Edit--add;D at the end: \ Mysql\bin (bin folder corresponding directory)

Check that the MySQL directory has no data directory;

If there is a data directory, ignore this point;

If not, win+r open to run, enter cmd into the command window;

Enter the drive letter for MySQL. For example: D:

then CD to the MySQL of the bin directory, execute the following statement: mysqld--initialize-insecure--user=mysql;d ata The catalog was built successfully. ------ or perform mysqld--initialize-insecure generate a password-free Root user. The command mysqld--initialize automatically generates a root user with a random password . Here, the first command is used to generate a root user without a password . (PS: Because There is no data folder in the extracted MySQL folder , this command will automatically generate Data folder, recommended to use mysqld--initialize-insecure command here)

Register MySQL as a Windows system service (or copy the My.ini file to the C-drive Windows folder)

  1 ) from the console into MySQL unzip directory under Bin under directory:
    2
) Enter the Service installation command:
   
 mysqld installmysql--defaults-file= "D:\mysql \my.ini" or in bin used under directory mysqld--install Statement Installation MySQL Services
    #
Unzip directory modified my.ini file
    
the installation succeeds and the service installation is prompted.
    #
Note: my.ini file is placed in MySQL after extracting the root directory
    #
The Remove Service command is: mysqld Remove

3 ) Start MySQL Service

method One :
The start service command is:net start MySQL
Method Two:
Open the Administration Tools Service and locate the MySQL service.
Start the service by right-clicking to start or by tapping on the left-hand boot directly.

9. Enter MySQL and change password

Under MySQL directory, edit My-default.ini

Add a line under [Mysqld] skip-grant-tables temporarily cancel the password;

1, restart MySQL,;

2, enter Mysql-uroot-p press ENTER, if prompted to enter the password, directly enter can;

, 3, after successful login, enter update Mysql.user setauthentication_string=password (' 123456 ') where user= ' root ' and Host = ' localhost '; Change the password to 123456 first;

4, enter flush privileges; refresh and save;

5, delete the My-default.ini just added skip-grant-tables save;

6,exit; or quit; Quit MySQL;

7, restart MySQL;

8, use the new password login: mysql-uroot-p123456 Return to the successful landing;

9. Place the required PHP extension DLLs in the Ext folder

Restart both Apache and the computer.

write such a piece of code to Test have been and MySQL connection is normal. The code is as follows:

<?php

$link =mysql_connect (' localhost ', ' root ', ');

If (! $link) echo "fail";

Else echo "Success";

Mysql_close ();

?>

Save As mysqltest.php . Saved in the Web root directory.

finally with phpMyAdmin Management database, unable to login? See also (http://jingyan.baidu.com/article/495ba841ef412d38b30edeb2.html)

Apache+php+mysql Operating Environment

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.