Set up and configure apache + php + mysql and windows8.1apache under windows8.1

Source: Internet
Author: User
Tags mysql connect php development environment

Set up and configure apache + php + mysql and windows8.1apache under windows8.1
Software Version:

Apache: Apache 2.4.10 Win64 http://www.apachelounge.com/download/VC11/binaries/httpd-2.4.10-win64-VC11.zip

PHP: VC11 x64 Thread Safe http://windows.php.net/downloads/releases/php-5.6.0-Win32-VC11-x64.zip

MySql: 5.5 win64

Visual C ++ Redistributable for Visual Studio 2012 http://download.microsoft.com/download/9/C/D/9CD480DC-0301-41B0-AAAB-FE9AC1F60237/VSU4/vcredist_x64.exe

 

Mysql installation:

Double-click "run" to set the user name, password, and encoding (utf8). The steps are omitted!

PHP configuration:

1. decompress the downloaded zip file to a directory. In this tutorial, enter: D: \ Program Files \ php.

2. Copy the php. ini-development file and change it to php. ini;

3. Search for the keyword php_mysqli.dll in the php. ini file, remove ";" before the row, and enable mysql extension (using mysql database );

4. Search for the keyword extension_dir and change it to extension_dir = "D:/Program Files/php/ext" (depending on the directory );

5. Modify in sequence

Support session: session. save_path = "e:/temp"
Upload File directory configuration: upload_tmp_dir = "e:/temp"
Time zone configuration: date. timezone = Asia/Shanghai

Apache configuration:

0. Install Visual C ++ Redistributable for Visual Studio 2012

1. decompress the downloaded zip file to drive C: \ Apache24.

2. Locate the httpd. conf file in the conf directory and add the following content to the LoadModule: (the directory is modified based on the specific php Directory)

LoadModule php5_module "D:/Program Files/php/php5apache2_4.dll"
PHPIniDir "D:/Program Files/php"

3. Locate AddType and add the following content to it:

AddType application/x-httpd-php. php
AddType application/x-httpd-php. html

4. If you want to modify the apache port, locate Listen 80. For example, change it to Listen 8088.

5. Install the apache service.

Open a dos window as an administrator. If it is not an administrator, an error is reported. Win8 and win8.1 systems can search by C on the start page. The first one is a command prompt, right-click, and select Run as administrator.

The default path of the command prompt is C: \ windows \ system32. If you put the apache24 folder to the C root directory, enter: cd c: \ apache24 \ bin, press enter to enter the bin folder, and then enter: httpd.exe-k install. (Of course, start | stop | restart is always used for the "-k" parameter and httpd.exe-k start | stop | restart" parameter .)

If the installation is successful, you can double-click apachemonitor.exe under your apachedirectory to manage the apache service.

Test Configuration:

View http: // localhost/index.html. (If you have modified the port, for example, http: // localhost: 8088/index.html in this tutorial, "It works!" is displayed !", Indicates that apache is successfully started.

Create an index. php file in the directory C: \ Apache24 \ htdocs (default apache website directory,

<?phpphpinfo();?>

Browse: http: // localhost/index. php. If you have modified the port, for example, http: // localhost: 8088/index. php In this tutorial

The php version information page is displayed:

Test the mysql connection. Create the mysql. php file in the directory just now, as shown below:

<?php$connect=new mysqli("localhost","root","root","test");if(!$connect) echo "Mysql Connect Error!";else echo "mysql success";$connect->close();?>

When mysql. php is opened on the page, mysql success is output.


How can I build a PHP development environment with MySQL + Apache2 + PHP5 in win7?

1. Install apache_2.2.4-win32-x86-no_ssl.msi on d: \ phpWeb \ APACHE \
Step: Next Step
2.install php-5.2.0-win32.zip to d: \ phpWeb \ php \
Step: (1) decompress the compressed package to d: \ phpWeb \ php \
(2) Find the php. ini-dist in the php Directory and rename it as php. ini and copy it to the windows directory.
(3) Copy php5ts. dll and libmysql. dll in the php Directory to the system directory (system/system32)
3. Configure apache
Step: (1) open the file d: \ phpWeb \ APACHE \ conf \ httpd. conf.
(2) Find DocumentRoot "D:/phpWeb/APACHE/htdocs" and change it to your WEB directory (if you do not change it, it may cause an error)
(3) locate the DirectoryIndex index.htmlline and add index.html. var index.htm index. php
(4) Find the # LoadModule ssl_module modules/mod_ssl.so line, and add the following line: LoadModule php5_module d:/phpWeb/php/php5apache2_2.dll.
(5) Find AddType application/x-gzip. gz. tgz and add AddType application/x-httpd-php. php
4. Configure php
Step: (1) locate c: \ windows \ php. ini and open it (copied just now)
(2) Find extension_dir = "./" to extension_dir = "d:/phpWeb/php/ext"
(3) locate; extension = php_mysql.dll remove the previous; number
(4) Find; session. save_path = remove the front; set the path "d:/phpWeb/php/session_temp" and create the folder session_temp under this path.

5. You can install MySQL.

Installation and configuration of Apache + php + mysql in windows

Hello, beginner, we recommend that you directly use the php integrated environment, such as WampServer. In addition, if you do not understand this, the environment is set up and will not be used. We recommend that you study php100, free and relatively systematic, I think it is good. Hope to help you, and wish you success!

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.