centos7.4安装php7.4.7及imagick,redis,memcached扩展

1.安装php7.4
yum install libjpeg libjpeg-devel
./configure --prefix=/usr/local/php7
--with-config-file-path=/usr/local/php7/etc
--with-freetype-dir=/usr/include/freetype2 \
--enable-gd-native-ttf
--with-jpeg-dir=/usr/include
--with-mcrypt=/usr/include
--with-mysqli=mysqlnd
--with-pdo-mysql=mysqlnd
--with-mysql-sock=/tmp/mysql.sock
--enable-mysqlnd
--with-gd
--with-iconv
--with-zlib
--enable-bcmath
--enable-shmop
--enable-sysvsem
--enable-inline-optimization
--enable-mbregex
--enable-fpm
--enable-mbstring
--enable-ftp
--enable-gd-native-ttf
--with-openssl
--enable-sockets
--with-xmlrpc
--enable-zip
--enable-soap
--with-gettext
--with-curl
--with-jpeg-dir
--with-freetype-dir
make && make install

如果提示找不到oniguruma
yum -y install http://mirror.centos.org/centos-7/7.8.2003/cloud/x86_64/openstack-queens/Packages/o/oniguruma-6.7.0-1.el7.x86_64.rpm
yum -y install http://mirror.centos.org/centos-7/7.8.2003/cloud/x86_64/openstack-queens/Packages/o/oniguruma-devel-6.7.0-1.el7.x86_64.rpm

1.安装redis扩展
wget https://pecl.php.net/get/redis-5.2.2.tgz
tar xf redis-5.2.2.tgz
cd redis-5.2.2
/usr/local/php7/bin/phpize
./configure --with-php-config=/usr/local/php7/bin/php-config
make && make install

2.安装memcached扩展
2.1安装libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
./configure --prefix=/usr/local/libmemcached
make && make install
2.2安装memcached
wget https://pecl.php.net/get/memcached-3.1.5.tgz
tar xf memcached-3.1.5.tgz
cd memcached-3.1.5
/usr/local/php7/bin/phpize
./configure --enable-memcached --with-php-config=/usr/local/php7/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached-sasl
make && make install

3.安装imagick
wget https://pecl.php.net/get/imagick-3.4.4.tgz
tar xf imagick-3.4.4.tgz
cd imagick-3.4.4
/usr/local/php7/bin/phpize
./configure --with-php-config=/usr/local/php7/bin/php-config --with-imagick=/usr/local/imagemagick
make && make install

4.安装zip
1.wget https://libzip.org/download/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz cd libzip-1.2.0 2. ./configure make && make install
装完了之后找一下/usr/local/lib下有没有pkgconfig目录,有的话执行命令export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"指定PKG_CONFIG_PATH。
到这里问题解决!

5.nginx
wget http://nginx.org/download/nginx-1.18.0.tar.gz
tar -xzvf nginx-1.18.0.tar.gz
cd nginx-1.18.0
保存原来的旧nginx配置文件
cp /etc/nginx/nginx.conf nginx.conf.old
tar cvf nginx.confd.tar /etc/nginx/conf.d

./configure
--prefix=/usr/local/nginx
--sbin-path=/usr/sbin/nginx
--conf-path=/etc/nginx/nginx.conf
--pid-path=/run/nginx.pid
--with-http_ssl_module

你可能感兴趣的:(centos7.4安装php7.4.7及imagick,redis,memcached扩展)