$mode= Db::name(‘news’)->select();
if ($mode->isEmpty()) {
error(‘error’);
}
$mode= Db::name(‘news’)->select();
if ($mode->isEmpty()) {
error(‘error’);
}
# 安装rabbitmq-c依赖包
yum install libtool autoconf
# 安装rabbitmq-c ( 最好下载 0.5的,0.6安装可能会报错)
# 版本下载:https://github.com/alanxz/rabbitmq-c/releases/tag/v0.9.0
wget https://github.com/alanxz/rabbitmq-c/archive/v0.9.0.tar.gz
tar -zxvf v0.9.0.tar.gz
cd rabbitmq-c-0.9.0/
autoreconf -i
./configure –prefix=/usr/local/rabbitmq-c
make
make install
# 安装PHP扩展 amqp
wget http://pecl.php.net/get/amqp-1.9.4.tgz
tar zxvf amqp-1.9.4.tgz
cd amqp-1.9.4
/usr/local/php7.3/bin/phpize
./configure –with-php-config=/usr/local/php7.3/bin/php-config –with-amqp –with-librabbitmq-dir=/usr/local/rabbitmq-c
make
make install
# 编辑php.ini文件,增加amqp扩展支持
vim /usr/local/php/etc/php.ini
# 增加下面内容
; rabbitmq扩展支持
extension=amqp.so
# 重启php-fpm
/etc/init.d/php-fpm7.3 restart
fatal error: ext/standard/php_smart_str.h: No such file or directory
#include “ext/standard/php_smart_str.h”
^
compilation terminated.
make: *** [memcache.lo] Error 1
ERROR: `make’ failed
cd /usr/local/src/
git clone https://github.com/websupport-sk/pecl-memcache
cd pecl-memcache/
/usr/local/php/bin/phpize
./configure –with-php-config=/usr/local/php/bin/php-config
make && make install
Installing shared extensions: /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/
vim /etc/php.ini
extension_dir = “/usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/”
extension = “memcache.so”
/etc/init.d/php-fpm reload
一下是php7.2的安装位置
/usr/local/php7.2/bin/phpize
这个是swoole 4.2.9安装命令
./configure –with-php-config=/usr/local/php7.2/bin/php-config –enable-openssl –with-openssl-dir=/usr/local/openssl –enable-sockets –enable-mysqlnd
这个是开发的时候安装debug-log的情况
./configure –with-php-config=/usr/local/php7.2/bin/php-config –enable-openssl –with-openssl-dir=/usr/local/openssl –enable-sockets –enable-mysqlnd –enable-debug-log
–enable-swoole-debug | –enable-debug-log(>=4.2.0) debug是这样开启的
make clean && make && sudo make install