Centos7 + PHP7 Lamp Full set of the latest version configuration and MongoDB and Redis tutorials detailed _linux

Source: Internet
Author: User
Tags install php install mongodb install openssl mongodb openssl phpinfo redis install redis

All versions of the software will always be upgraded to see if their version has been updated.

First, install CENTOS7.

If you forget to set up the Swap section, the following article can teach you how to make up one:

Http://www.jb51.net/os/201409/338170.html

When CENTOS7 is installed, the default is not to surf the internet.

cd/etc/sysconfig/network-scripts/

Find a file like Ifcfg-enp0s3, modify the Onboot=yes

And then

Service Network restart

Install apache2 (CentOS called httpd)

Yum Install httpd

Start Apache2

Service httpd Start

Look, it's in effect.

Curl http://localhost

Set up auto Run

Chkconfig httpd on

Install PHP7

To update the source first

RPM-UVH https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Or

RPM-UVH https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Then Yum installation

Yum Install php70w

Restart Apache

Service httpd Restart

Look at the phpinfo.

vi/var/www/html/info.php
<?php phpinfo ();?>

Visit http://localhost/info.php

It's OK to see php7.0.x information.

Install mysql5.7

Update Source First

RPM-IVH http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm

Installation

Yum Install Mysql-community-server

mysql5.7 initial password is no longer empty, will tell you the password file address in the shell output, generally under ~/.mysql_secret

If this file is unfortunately not, there is no way, follow the following:

http://blog.csdn.net/qq_26941173/article/details/51548947

To set the boot boot:

Chkconfig mysqld on

Installing the PHP7 MySQL extension

Yum Install Php70w-mysql

Restart Apache2 Effective

Install MongoDB latest edition

MongoDB Official website's description is very detailed, according to do can:

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/

Install the PHP7 MONGO extension

We're going to put a bunch of stuff first.

Yum install php-pear
yum install php-devel yum-y install
gcc
yum install OpenSSL openssl-devel
Pecl Chan Nel-update pecl.php.net

And then through the pecl to install PHP7 MongoDB extension

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 edition, officially recommended.

Don't forget the php.ini plus

extension=mongo.so or extension=mongodb.so and reboot apache2

Install Redis Set

Can't use Yum, very uncomfortable.

Http://redis.io/download Download the latest version (currently 3.2.5)
wget http://download.redis.io/releases/redis-3.2.5.tar.gz
Tar xzf redis-3.2.5.tar.gz
CD redis-3.2.5

Make

Make may prompt hint:it ' s a good idea to run ' makes test '

Then run make test, which may indicate that TCL is not installed

Yum Install-y tcl

Re-make test and make

---

Errors can also occur 2:error:jemalloc/jemalloc.h:no such file or directory

Cause: Some compile dependencies or legacy problems with the original compilation

FIX: Make Distclean clean up and make again.

---

After the successful installation of the SRC directory will be more than Redis-server,redis-cli and other executable files

./src/redis-server Server Side

./SRC/REDIS-CLI Client

Install the PHP7 redis extension

PECL Install Redis

Modify php.ini Add extension=redis.so, and then restart Apache2

PS1:

If Yum is prompted for XXX not signed, add parameters--nogpgcheck

Well, here's the end of the article.

Related Article

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.