Centos7 + php7 lamp full set of the latest version configuration, as well as mongodb and redis, centos7mongodb
I am a lazy, but yum is yum.
All software versions are updated. Check whether your current version has been updated.
First install centos7
If you forget to set swap partitions, the following article will teach you how to add one:
Http://www.2cto.com/ OS /201409/338170.html
After centos7 is installed, Internet access is disabled by default.
cd /etc/sysconfig/network-scripts/
Locate the file like a ifcfg-enp0s3 and modify onboot = yes
Then
service network restart
Install apache2 (httpd in centos)
yum install httpd
Start apache2
service httpd start
Check if it takes effect
curl http://localhost
Set Automatic startup
chkconfig httpd on
Install php7
First, update the source
Rpm-Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmor rpm-Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Then install yum
yum install php70w
Restart apache
service httpd restart
See phpinfo.
vi /var/www/html/info.php<?php phpinfo(); ?>
Access http: // localhost/info. php
You can see the php7.0.x information.
Install mysql5.7
Update source first
rpm -ivh http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
Install
yum install mysql-community-server
The initial password of mysql5.7 is no longer blank. It will tell you the password file address in the shell output, generally in ~ /. Mysql_secret
If this file is unfortunately unavailable, there is no way to do so. perform the following operations:
Http://blog.csdn.net/qq_26941173/article/details/51548947
Set boot start:
chkconfig mysqld on
Install mysql extension for php7
yum install php70w-mysql
Restart apache2 to take effect
Install the latest mongodb version
The description on the official mongodb website is very detailed. Just do it:
Https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/
Install the mongo extension of PHP 7
First install a bunch of things
yum install php-pearyum install php-develyum -y install gccyum install openssl openssl-develpecl channel-update pecl.php.net
Then the mongodb extension of php7 is installed through pecl.
Pecl install mongo or pecl install mongodb
Mongo is an old version and will not be upgraded now, but many historical codes are in use. Mongodb is an extension of the new version, which is officially recommended.
Do not forget to add php. ini
Extension = mongo. so or extension = mongodb. so and restart apache2
Install a set of redis
You cannot use yum.
Http://redis.io/download download the latest version (currently 3.2.5)
wget http://download.redis.io/releases/redis-3.2.5.tar.gztar xzf redis-3.2.5.tar.gzcd redis-3.2.5make
After make, the Hint: It's a good idea to run 'make test' may be prompted'
Run make test, and you may be prompted that tcl is not installed.
yum install -y tcl
Re-make test and then make
---
There may also be errors 2: error: jemalloc/jemalloc. h: No such file or directory
Cause: Some compilation dependencies or issues left over from the original compilation
Solution: make distclean and then make.
---
After the installation is successful, the src directory contains multiple executable files, such as redis-server and redis-cli.
./Src/redis-server
./Src/redis-cli Client
Install redis extension for PHP 7
pecl install redis
Modify php. ini to add extension = redis. so, and then restart apache2.
PS1:
If xxx not signed is prompted during yum, add the -- nogpgcheck parameter.