所需包
https://pan.baidu.com/s/1Rr6uql5sGkZzqJJ9cXC6-g?pwd=8p5h
tar zxvf oniguruma-6.9.4.tar.gz
./autogen.sh
./configure --prefix=/usr --libdir=/lib64
make -j4
make install
或
yum install -y oniguruma
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure --prefix=/usr/local/libmcrypt
make -j4
make install
tar zxvf php-7.4.16.tar.gz
cd php-7.4.16
./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-fpm --enable-pdo --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl
make -j4
make install
cp php.ini-production /etc/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
cp /usr/local/php-7.4.16/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod 777 /etc/init.d/php-fpm
chkconfig php-fpm on
service php-fpm start
--安装swoole插件
tar zxvf swoole-4.6.6.tgz
cd swoole-4.6.6
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make -j4
make install
--安装redis插件
tar zxvf redis-5.3.4.tgz
cd redis-5.3.4
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make -j4
make install
--修改php.ini文件
vi /etc/php.ini
extension=swoole.so
extension=redis.so
swoole.use_shortname = off
service php-fpm restart
/usr/local/php/bin/php -m | grep swoole
/usr/local/php/bin/php -m | grep redis
/usr/local/php/bin/php --ini
/usr/local/php/bin/php /usr/local/lxim-im-server/bin/hyperf.php start
/usr/local/php/bin/php /usr/local/lxim-im-server/bin/hyperf.php stop