PHP7 Installation and Apache

Source: Internet
Author: User

1. Download PHP7

Select the thread safe version, if it is a 64-bit system to download x64, x86 not

2. Unzip to the directory you want to install

3.apache Configuration

1) Add PHP module

Find the section "Dynamic Shared Object (DSO) support". It's probably around 62 lines. and append the following code at the end:

LoadModule Php7_module D:/wangshuyi/php7/php7apache2_4.dll

2) Add extension

Find the section "AddType". Approximately 409 lines near, and append the following current code at the end:

AddType application/x-httpd-php. php

AddType Application/x-httpd-php-source. Phps

3) Specify the php.ini configuration file path

In the httpd.conf file, specify the directory of the PHP configuration file php.ini, where the httpd.conf file is located in the end, in the last line of text to add the following code:

Phpinidir "D:/WANGSHUYI/PHP7" (Here "D:/WANGSHUYI/PHP7" for the actual path of your php.ini file)

4) Configuration DirectoryIndex

Find the "DirectoryIndex" section, about 282 lines, append a "index.php" to the back of the DirectoryIndex

4. Configure PHP.ini

First, rename the php.ini-production in the PHP installation directory to php.ini

Open PHP.ini and make the following changes:

1) Set the extension path for PHP

Find Extension_dir = "ext" and remove the semicolon from the front

2) Turn on common PHP extensions, such as:

Extension=php_mbstring.dll (PHP Multi-byte string extension)

Extension=php_mysql.dll (MySQL library extension)

Extension=php_mysql.dll (mysqli Library extension)

Open mode: Find the above extension, the previous semicolon (;) to delete the line.

3) Set the default time zone

Date.timezone = Asia/shanghai

Open mode: Find the above extension, the previous semicolon (;) to delete the line

Well, here's the procedure for installing configuration PHP7.0 on a Windows server, let's test it.

Iv. Testing

Create a new index.php in your Apache site directory (it can be another name, of course).

Open with a text editor (Notepad, for example), add the following code inside, save

<?php

Phpinfo ();

?>

If the configuration is successful

PHP7 Installation and Apache

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.