Ubuntu14.04 Server environment to configure PHP7.0+Apache2+Mysql5.7 method
- 2020-11-18 06:34:18
- OfStack
The example of this article describes the method to configure PHP7.0+Apache2+ ES4en5.7 in es1EN14.04 server environment. To share for your reference, the details are as follows:
Here, es8EN7.0 +Apache2+Mysql5.7 is configured for Ubuntu14.04 system. The main purpose is to try out WordPress.
Update system resources
sudo apt-get update
sudo apt-get uograde
Apache2
Install apache
sudo apt-get apache2
Edit apache main configuration file/etc apache2 / apache2 conf, modify KeepAlive Settings
KeepAlive Off
Apache default multi-ES35en module (MPM) is one event module, but php defaults to prefork module, event module disabled, prefork module enabled
sudo a2dismod mpm_event
sudo a2enmod mpm_prefork
Restart Apache
sudo service apache2 restart
If you see an error about ServerName when you restart Apache, you can make the following changes
(1) edit apache main configuration file/etc apache2 / apache2 conf
Add 1 line
ServerName localhost
And then execute
sudo service apache2 restart
Mysql5.7
Since there is no source of Mysql5.7 under Ubuntu14.04, it is necessary to connect to the external repository for downloading
wget http://dev.mysql.com/get/mysql-apt-config_0.6.0-1_all.deb
sudo dpkg -i mysql-apt-config_0.6.0-1_all.deb
sudo apt-get update
sudo apt-get install mysql-server
# Input during installation root The password
When the installation is complete, execute
mysql_secure_installation
, complete the security Settings according to the prompts
PHP7.0
The default source under Ubuntu14.04 is PHP5.0, so you also need to add an external source
Personal Package Archive(PPA) is an apt repository that allows third party developers to publish external resources for ubuntu
Ondř ej Surý PHP7.0 for PPA is provided
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0
LAMP
Integrate PHP and Mysql
sudo apt-get install php7.0-mysql
Integrate PHP and Apache
sudo apt-get install libapache2-mod-php7.0
sudo service apache2 restart
Verify the environment
Displays version information for PHP
php -v
Apache default site is located in the root directory/var/www html /, enter the directory, and create info. php
sudo apt-get apache2
0
sudo apt-get apache2
1
In the browser input http: / / localhost info php for validation
Hopefully this article has helped you with your Ubuntu server configuration.