This article mainly introduces you to the whole process of installing PHP7 Mac. Have a good reference value, hope to help you. Follow the small series together to see it, hope to help everyone.
Updating the System library
Yum-y install gcc gcc-c++ automake autoconf libtool make Lrzsz expect asciidoc Xmlto expat-devel.x86_64 texinfoyum-y ins Tall gcc gcc-c++ glibc libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freety Pe-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel Curl Curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel OpenSSL openssl-devel
Installing the PCRE Regular expression library
Cd/usr/local/src//wget Ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gzwget ftp:// FTP.CSX.CAM.AC.UK/PUB/SOFTWARE/PROGRAMMING/PCRE/PCRE-8.40.TAR.GZTAR-ZXVF PCRE-8.40.TAR.GZCD pcre-8.40./ Configuremake && make Install
Installing the Zlib Library
Cd/usr/local/src//wget Http://zlib.net/zlib-1.2.8.tar.gzwget HTTP://ZLIB.NET/ZLIB-1.2.11.TAR.GZTAR-ZXVF ZLIB-1.2.11.TAR.GZCD zlib-1.2.11./configuremake && make install
Installing the SSL Library
Cd/usr/local/src//wget Https://www.openssl.org/source/openssl-1.0.2h.tar.gzwget https://www.openssl.org/source/ OPENSSL-1.1.0E.TAR.GZTAR-ZXVF openssl-1.1.0e.tar.gz
Installing Nginx
Cd/usr/local/srcwget HTTP://NGINX.ORG/DOWNLOAD/NGINX-1.10.3.TAR.GZTAR-ZXVF NGINX-1.10.3.TAR.GZCD nginx-1.10.3./ Configure--sbin-path=/usr/local/nginx/nginx--conf-path=/usr/local/nginx/nginx.conf--pid-path=/usr/local/nginx/ Nginx.pid--with-http_ssl_module--with-pcre=/usr/local/src/pcre-8.40--with-zlib=/usr/local/src/zlib-1.2.11-- With-openssl=/usr/local/src/openssl-1.1.0emake && make Install
Error occurred, to reinstall MCrypt
Error:mcrypt.h not found. Please reinstall Libmcrypt.
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz TAR-ZXVF libmcrypt-2.5.7.tar.gz CD libmcrypt-2.5.7./configure make && make install
Installation Library
echo "/usr/local/lib" >>/etc/ld.so.conf.d/local.confldconfig-v
Installing PHP7
Cd/usr/local/srcwget HTTP://CN2.PHP.NET/DISTRIBUTIONS/PHP-7.1.3.TAR.GZTAR-ZXVF PHP-7.1.3.TAR.GZCD php-7.1.3./ Configure--prefix=/usr/local/php \--with-mcrypt \--with-curl \--with-jpeg-dir \--with-freetype-dir \--with-gd \--wit H-gettext \--with-iconv-dir \--with-kerberos \--with-libdir=lib64 \--with-libxml-dir \--with-mysqli \--with-openssl \--with-pcre-regex \--with-pdo-mysql \--with-pdo-sqlite \--with-pear \--with-png-dir \--with-xmlrpc \--with-xsl \- -with-zlib \--enable-fpm \--enable-bcmath \--enable-libxml \--enable-inline-optimization \--enable-gd-native-ttf \-- Enable-mbregex \--enable-mbstring \--enable-opcache \--enable-pcntl \--enable-shmop \--enable-soap \--enable-sockets \--enable-sysvsem \--enable-xml \--enable-zipmake && make INSTALLCP php.ini-production/usr/local/php/lib/php . ini
Modify PHP User
CD/USR/LOCAL/PHP/CP etc/php-fpm.conf.default etc/php-fpm.conf CP etc/php-fpm.d/www.conf.default etc/php-fpm.d/ www.conf groupadd www useradd-g www www vim etc/php-fpm.d/www.conf Modify configuration user and group changed to WWW vim/usr/local/nginx/nginx . conf
Modify Nginx Configuration
Cd/usr/local/nginx/vim nginx.conf include Conf.d/*.conf;mkdir conf.dvim conf.d/www.confserver { listen; server_name xxxxx; root/var/www/xxxxx; Location/{ index index.php; } Location ~ \.php { Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Client_max_body_size 60m; Include Fastcgi_params; } if (!-e $request _filename) { rewrite ^/(. *)/index.php/$1 last; }}
Installing mysql5.6
Download mysql5.6
Cd/usr/local/src/wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.30.tar.gz
Installing CMake
cd/usr/local/src/ wget https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz tar xzvf cmake-3.5.2.tar.gz CD cmake-3.5.2 ./bootstrap gmake gmake Install
Install MySQL
Cd/usr/local/src/groupadd mysqluseradd-g mysql mysqltar xzvf mysql-5.6.30.tar.gzcd mysql-5.6.30cmake. Make && m Ake Installchown-r mysql:mysql/usr/local/mysqlcd/usr/local/mysql/rm-rf/etc/my.cnfscripts/mysql_install_db--user= MYSQLCP support-files/my-default.cnf/etc/my.cnfvi/etc/profile path=/usr/local/mysql/bin: $PATH export PATHsource/ ETC/PROFILECP support-files/mysql.server/etc/init.d/mysqlchmod +x/etc/init.d/mysqlchkconfig MySQL onservice mysql Start
Modify Authorization
Mysql-uroot-puse Mysqlselect Host,user,password from User;delete from user where user = ' '; update user Set password = PA ssWOrd (' 1234qwer ') where user = ' root ';//update user set host = '% ' where user = ' root '; flush privileges;
Install Git
Yum-y Install lrzsz yum-y install Openjade texinfo perl perl-xml-sax.noarch RPM-IVH http://mirror.nl.leaseweb.net/epel/ 6server/x86_64/docbook2x-0.8.8-1.el6.x86_64.rpm (CENTOS6) RPM-IVH http://dl.fedoraproject.org/pub/epel/7/x86_64/d /docbook2x-0.8.8-17.el7.x86_64.rpm (CENTOS7) cd/usr/bin/ln-s db2x_docbook2texi docbook2x-texi cd/usr/local/src wget h ttps://codeload.github.com/git/git/zip/v2.8.3 Unzip v2.8.3 CD git-2.8.3 make prefix=/usr install Install-doc install-html install-info (yum install perl-extutils-cbuilder perl-extutils-makemaker) make install
Installing PHP yaf, Redis extensions
Cd/usr/local/srcwget https://pecl.php.net/get/yaf-3.0.4.tgz tar-zxvf yaf-3.0.4.tgz cd yaf-3.0.4/usr/local/php/bin/ Phpize./configure--with-php-config=/usr/local/php/bin/php-config make && make install CD/USR/LOCAL/SRC wget HTTPS://CODELOAD.GITHUB.COM/PHPREDIS/PHPREDIS/ZIP/PHP7 Unzip Phpredis-php7.zip CD phpredis-php7/usr/local/php/bin/ Phpize./configure--with-php-config=/usr/local/php/bin/php-config make && make install Vim/usr/local/php/lib /php.ini extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20151012/yaf.so extension=/usr/local/php/ Lib/php/extensions/no-debug-non-zts-20151012/redis.so extension=/usr/local/php/lib/php/extensions/ No-debug-non-zts-20160303/yaf.so extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/redis.so
Installing Redis
cd/usr/local/src///wget http://download.redis.io/releases/redis-3.2.80.tar.gz wget http://download.redis.io/ redis-stable.tar.gz//tar xzf redis-3.2.8.tar.gz tar xzf redis-stable.tar.gz cd redis-3.2.8 CD redis-stable make CP src/re Dis-server/etc/init.d/redis CP redis.conf/etc/redis.conf chmod +x/etc/init.d/redis service redis/etc/redis.conf &