Ubuntu---"Turn" installation lamp (php7.0)

Source: Internet
Author: User

This article turns from: http://www.laozuo.org/8303.html. In case of loss, record again

PHP7 has been out for some time, according to the user's practice test than the previous version of the efficiency will be much higher, and the application to the site open speed will be significantly improved. But not all CMS program compatibility and support, the current mainstream WordPress and other programs compatibility is good, other programs to see the actual use, including program and component plug-in support. If we are not at ease or incompatible for the time being, then temporarily use versions such as PHP5.6.

Today, I see an article about installing lamp on Ubuntu environment, of course, including compiling and installing PHP7 version, it is simple toss and experience the process of this environment, if actually apply to the project or according to our actual needs and skills use.

Old left before have shared lamp environment article:

1, Centos/debian/ubuntu System One-click Installation Lnmp/lamp/lnmpa website environment

2, complete configuration CentOS6 installation lamp (apache/mysql/php) Environment Construction Tutorial

First, Ubuntu installation PHP7 version lamp preparation

Apt-get update && sudo apt-get upgrade

Upgrade and update the source in our installed Ubuntu 16.04 system.

Second, lamp environment installation and configuration Apache

1. Installing Apache 2.4

Apt-get Install Apache2-y

Install Apache directly from the system library.

2. Modify APACHE2.CONF Configuration

/etc/apache2/apache2.conf

KeepAlive OFF

Modify parameter keepalive to OFF

3. Modify MPM_PREFORK.CONF Configuration

/etc/apache2/mods-available/mpm_prefork.conf

Set parameters:

<ifmodule mpm_prefork_module>
Startservers 2
Minspareservers 6
Maxspareservers 12
Maxrequestworkers 39
Maxconnectionsperchild 3000
</IfModule>

4. Disabling and starting the module

sudo a2dismod mpm_event
sudo a2enmod mpm_prefork

5. Restart Apache

sudo systemctl restart Apache2

Third, configure the virtual host environment

1. Copy the default configuration file

sudo cp/etc/apache2/sites-available/000-default.conf/etc/apache2/sites-available/laozuo.org.conf

2. Modify the configuration file

/etc/apache2/sites-available/laozuo.org.conf

Here we need to compile the current site configuration file.

<Directory/var/www/html/laozuo.org/public_html>
Require all granted
</Directory>
<virtualhost *:80>
ServerName laozuo.org
Serveralias www.laozuo.org
ServerAdmin [email protected]
Documentroot/var/www/html/laozuo.org/public_html

Errorlog/var/www/html/laozuo.org/logs/error.log
Customlog/var/www/html/laozuo.org/logs/access.log combined

</VirtualHost>

3. Create the required directory/file

sudo mkdir-p/var/www/html/laozuo.org/{public_html,logs}

4. Start the site

sudo a2ensite laozuo.org.conf

5. Disable the default root directory configuration

sudo a2dissite 000-default.conf

6. Restart Apache

sudo systemctl reload apache2

Iv. installing the MySQL Database

1. Install the database

sudo apt-get install Mysql-server

In the installation process, you need to set the MySQL database root account password, enter two times.

2. Configure Database Security

Mysql_secure_installation

As prompted, we need to clean up the default tables and set up the database security. There have been a lot of documents set up here before, can refer to.

The lamp compiles and installs the PHP7

Here is the key, other we may have similar settings can refer to the previous article, PHP7 compilation has not yet the article, study together.

1. Installation of PHP7 and response extension

sudo apt-get install php7.0 php-pear libapache2-mod-php7.0 php7.0-mysql

2. Installation component Support

sudo apt-get install Php7.0-curl Php7.0-json php7.0-cgi

3. configuration file/etc/php/7.0/apache2/php.ini

Max_input_time = 30
error_reporting = E_compile_error | E_recoverable_error | E_error | E_core_error
Error_log =/var/log/php/error.log

4. Create a log directory

sudo mkdir/var/log/php
sudo chown www-data/var/log/php

5. Restart Apache

sudo systemctl restart Apache2

VI. Test PHP7 Environment Support

So far we have created the lamp environment, we can drop a probe phpinfo in the domain name site directory that is bound above, and then detect whether the PHP7 version is supported.

VII, Ubuntu installation PHP7 version lamp summary

1, if our technology is good, and like to toss, you can use this method to install the environment, if we actually need and urgent use, it is a more mature one-key package or panel.

2, not all programs and components are currently compatible with PHP7, so we need to determine the support before going to use.

Ubuntu---"Turn" installation lamp (php7.0)

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.