Installation and configuration of Apache2.2 + MySql5.5 + PHP5.4 (windows)

Source: Internet
Author: User

Installation and configuration of Apache2.2 + MySql5.5 + PHP5.4

PhpMyAdmin installation and configuration

Install Apache2.2

Http://httpd.apache.org/download.cgi#apache24

Win32 Binaryincluding OpenSSL 0.9.8t (MSI Installer): httpd-2.2.22-win32-x86-openssl-0.9.8t.msi [PGP]
[MD5]
[SHA1]

If Apache cannot be started after installation! Because php5apache2_2.dll cannot be loaded, it indicates that it was not uninstalled cleanly before apache was uninstalled. After uninstallation, you also need to delete all of his files! And then reload it!

Enter localhost in the browser to display It works! The installation is successful! For example:

Let's take a look at the apache2.2 Server icon after installation. The icon is displayed on one line in the image, and the next line shows simple functions. Note that the "Restart" button is very important, after changing the configuration files such as php and apache, you must restart apache to load the new configuration.

StartConfigure Apache

Find the configuration file first. There are two methods.

Method 1: My configuration file is in D: \ Program Files (x86) \ Apache SoftwareFoundation \ Apache2.2 \ conf \ httpd. conf

You can find this file based on the installation path you just selected, and open it with Notepad, Notepad ++, and other text editing software!

Method 2: Search for the ApacheHTTP Server2.2 folder in the Start Menu. the httpd. conf file is found below.

The files found in the two methods are the same.

Important settings

1. The default port number is 80. to modify the port number, you can modify Line 46.

# Listen 12.34.56.78: 80

Listen 80

 

2. Main directory of the web page: the default main directory of My Apache is as follows. Here, you need to change it to the address of the self-built website directory. Instead, change it to "D:/www"

DocumentRoot "D:/Program Files (x86)/Apache SoftwareFoundation/Apache2.2/htdocs"

Here I change it to (pay attention to the backslash)

DocumentRoot "I:/EaglePHP"

 

3. directory permission: Apache allows users to browse Web directories by default, which is not safe. You can change it to disabled. (Only one row can exist in the following two rows)

Options Indexes FollowSymLinks # enabled by default

Options FollowSymLinks # open it here

 

4. Homepage name: the first page name of apacheappsis index.html. Add index. php here.

Originally:

<IfModule dir_module>

DirectoryIndex index.html

</IfModule>

Now:

<IfModule dir_module>

DirectoryIndex index. php index.html

</IfModule>

And save the changes. Then, restart the apache server!

 

Generally, enter localhost in the browser and you will find that the information cannot be accessed:

Forbidden

You don't have permission to access/on this server.

We need to modify the permission! That is, to enable the apache rewrite module, allow URL rewriting, and support. htaccess files under the program directory.

1. Find the configuration file

#

# AllowOverridecontrols what directives may be placed in. htaccess files.

# It can be "All", "None", or any combination of the keywords:

# Options FileInfo AuthConfig Limit

#

AllowOverride None

Change

AllowOverride All

2. Then find

<Directory/>

OptionsFollowSymLinks

AllowOverrideNone

Orderdeny, allow

Deny from all

</Directory>

Change

<Directory/>

OptionsFollowSymLinks

AllowOverride All

Orderdeny, allow

Allow from all

</Directory>

You can! (Note that two "All" are modified)

 

3. Find LoadModule rewrite_module modules/mod_rewrite.so and remove the previous #

 

4. Add at the end of the file: (this has not found any function yet, and it does not matter if it is not added)

 

<IfModule mod_Rewrite.c>

RewriteEngine On

RewriteRule ^ (. *)/archiver/(fid | tid)-[\ w \-] + \. html) $1/archiver/index. php? $2

RewriteRule ^ (. *)/forum-([0-9] +)-([0-9] +) \. html $1/forumdisplay. php? Fid = $2 & page = $3

RewriteRule ^ (. *)/thread-([0-9] +)-([0-9] +)-([0-9] + )\. html $1/viewthread. php? Tid = $2 & extra = page \ % 3D $4 & page = $3

RewriteRule ^ (. *)/space-(username | uid)-(. +) \. html $1/space. php? $2 = $3

RewriteRule ^ (. *)/tag-(. +) \. html $1/tag. php? Name = $2

</IfModule>

 

RewriteEngine On

RewriteRule ^ (. *)-htm-(. *) $ index. php? $2

 

Install Mysql

If you want to delete the files that have been installed before, delete the files in the C:/ProgramData/MySQL Server 5.5/Data directory!

 

Next mysql-5.5.25-win32.msi (note size 31.1 MB)

Http: // 222.218.45.52: 82/down/mysql-5.5.25-win32.zip

Traditional Installation

Modify path

Setup is complete! Keep clicking next

Enter the password here. Remember it!

After waiting for half a day, the following error occurs:

You cannot use port 3306. Click Skip and then click '<back' to modify the port. (It may also be caused by repeated installation of MySQL. The solution is written in the last section)

In this case, if it fails again, close it. Go to D: \ ProgramFiles (x86) \ MySQL Server 5.5 \ bin, open mysqlinstanceconfig.exe, set it, and run it again. If it doesn't work, delete and reinstall it all. If not, check Baidu.

Installation successful:

An error occurred when installing mysql.

1. Warning: ob_start (): output handler 'ob _ gzhandler' conflicts with 'zlib outputcompression' in I: \ EaglePHP \ Lib \ Main. inc. php on line 10

 

This is because the Zlib module in PHP is incorrectly set. Just comment out the zlib. output_compression line. It should be noted that PHP5 comes with the GZIP module and does not need to be loaded separately.

2. mysql cannotcreate windows service for mysql error 0

Solution

Http://www.webjx.com/database/mysql-6509.html

Http://apps.hi.baidu.com/share/detail/30095318

Wait a moment ~

 

Where can I find the databases created in mysql ??

Http://zhidao.baidu.com/question/132870827

The installation path for MySQL is my. ini.

Open datadir in Notepad

There is a path behind

Mine is:

C:/ProgramData/MySQL Server 5.5/Data

You can see the DB under this path. A folder corresponds to a DB.

Http://www.zihou.me/html/2010/04/02/1989.html

 

 

Install php

Although php5.4.4 is available now, I chose to install 5.3.14. The address is

Http://windows.php.net/download/?php-5.4page zip [14.97 MB], that is:

Http://windows.php.net/downloads/releases/php-5.4.5-Win32-VC9-x86.zip

Decompress the folder, change it to php, and put it on drive D.

Open the php folder and find the following file:


Remove '-development' and use NotePad to open the php. ini file and start Configuration:

1. Search extension_dir

Set

; On windows:

; Extension_dir = "ext"

Change

; On windows:

Extension_dir = "D: \ php \ ext"

2. Search

Extension = php_curl.dll

Extension = php_gd2.dll

Extension = php_mbstring.dll

Extension = php_mysql.dll

Extension = php_pdo_mysql.dll

Extension = php_pdo_odbc.dll

Extension = php_xmlrpc.dll

Open them all

 

Open httpd. conf and add the following at the end:

LoadModule php5_module "D:/php/php5apache2_2.dll"

 

AddHandler application/x-httpd-php. php

AddHandler application/x-httpd-php. htm

# Configure the path to php. ini

PHPIniDir "D:/php"

 

After the installation, their configuration files are

Mysql configuration file

D: \ Program Files (x86) \ MySQL Server 5.5 \ my. ini

Php configuration file

D: \ php. ini

Apache configuration file

D: \ Program Files (x86) \ Apache Software Foundation \ Apache2.2 \ conf \ httpd. conf

 

 

Other problems

1. Data connection problems

$ Connect = mysql_connect ("localhost: 3307", "root", "123456 ");

If the port changes, pay attention to the settings! Otherwise, the connection fails. The default port is 3306. You can also set the default port number in the php. ini file.

Install phpMyAdmin-a good tool for managing mysql (provided that the previous platform is configured)

Decompress the downloaded phpMyAdmin package. If you are banned from the previous configuration, this configuration will be difficult for you. Put it in the home directory of your website (for settings of DocumentRoot mentioned earlier, I have set I:/EaglePHP). You can see that there is an index in the phpMyAdmin folder. php file. Obviously, it is the portal webpage file. We can enter localhost in the browser to enter the folder set by DocumentRoot. Now we only need to change it to localhost/phpMyAdmin, you can find the phpMyAdmin webpage portal. Find out how to save and import the database.

Missing
MysqliExtension. Check PHP configuration

Http://zhidao.baidu.com/question/297100451.html

Open the config. default. php file under I: \ EaglePHP \ Pub \ phpMyAdmin \ libraries. Note the following changes:

Note: $ cfg ['servers'] [$ I] ['Port'] = '000000'. You need to modify the value when it changes.

If not, open my. in the INI file, modify port = 3306 to port = 3307. [Note that the ports here are all corresponding. If you select 3306, the ports are both 3306 and 3307 respectively]

 

4.How to Use localhost to connect to MYSQL5.3 in Windows 7

In Windows 7, when PHP is connected to Mysql, the IP address can only be used by default to connect to Mysql, but localhost cannot be used to connect to Mysql. The solution is to open C: \ Windows \ System32 \ drivers \ etc hosts file

#127.0.0.1 localhost

To remove the annotations.

5. Install 32-bit computing. You are a 64-bit computer.

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.