日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mac php7 mysql.so_mac下安装php7详解

發布時間:2025/3/21 数据库 13 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mac php7 mysql.so_mac下安装php7详解 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

本文主要為大家介紹一下mac 下安裝php7全過程。具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧,希望能幫助到大家。

更新系統庫

yum -y install gcc gcc-c++ automake autoconf libtool make lrzsz expect asciidoc xmlto expat-devel.x86_64 texinfo

yum -y install gcc gcc-c++ glibc libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype

freetype-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

安裝pcre 正則表達式庫

cd /usr/local/src

//wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz

tar -zxvf pcre-8.40.tar.gz

cd pcre-8.40

./configure

make && make install

安裝Zlib庫

cd /usr/local/src

//wget http://zlib.net/zlib-1.2.8.tar.gz

wget http://zlib.net/zlib-1.2.11.tar.gz

tar -zxvf zlib-1.2.11.tar.gz

cd zlib-1.2.11

./configure

make && make install

安裝SSL庫

cd /usr/local/src

//wget https://www.openssl.org/source/openssl-1.0.2h.tar.gz

wget https://www.openssl.org/source/openssl-1.1.0e.tar.gz

tar -zxvf openssl-1.1.0e.tar.gz

安裝nginx

cd /usr/local/src

wget http://nginx.org/download/nginx-1.10.3.tar.gz

tar -zxvf nginx-1.10.3.tar.gz

cd 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.0e

make && make install

出現報錯,要重新安裝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

安裝庫

echo "/usr/local/lib">> /etc/ld.so.conf.d/local.conf

ldconfig -v

安裝php7

cd /usr/local/src

wget http://cn2.php.net/distributions/php-7.1.3.tar.gz

tar -zxvf php-7.1.3.tar.gz

cd php-7.1.3

./configure --prefix=/usr/local/php \

--with-mcrypt \

--with-curl \

--with-jpeg-dir \

--with-freetype-dir \

--with-gd \

--with-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-zip

make && make install

cp php.ini-production /usr/local/php/lib/php.ini

修改php用戶

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

修改配置中的user和group改為www

vim /usr/local/nginx/nginx.conf

修改nginx配置

cd /usr/local/nginx/

vim nginx.conf

include conf.d/*.conf;

mkdir conf.d

vim conf.d/www.conf

server {

listen 80;

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;

}

}

安裝mysql5.6

下載mysql5.6

cd /usr/local/src/

wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.30.tar.gz

安裝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

安裝mysql

cd /usr/local/src/

groupadd mysql

useradd -g mysql mysql

tar xzvf mysql-5.6.30.tar.gz

cd mysql-5.6.30

cmake .

make && make install

chown -R mysql:mysql /usr/local/mysql

cd /usr/local/mysql/

rm -rf /etc/my.cnf

scripts/mysql_install_db --user=mysql

cp support-files/my-default.cnf /etc/my.cnf

vi /etc/profile

PATH=/usr/local/mysql/bin:$PATH

export PATH

source /etc/profile

cp support-files/mysql.server /etc/init.d/mysql

chmod +x /etc/init.d/mysql

chkconfig mysql on

service mysql start

修改授權

mysql -uroot -p

use mysql

select host,user,password from user;

delete from user where user = '';

update user set password = PASSWORD('1234qwer') where user = 'root';

//update user set host = '%' where user = 'root';

flush privileges;

安裝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 https://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

安裝php的yaf、redis擴展

cd /usr/local/src

wget 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

安裝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/redis-server /etc/init.d/redis

cp redis.conf /etc/redis.conf

chmod +x /etc/init.d/redis

service redis /etc/redis.conf &

總結

以上是生活随笔為你收集整理的mac php7 mysql.so_mac下安装php7详解的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。