分类目录归档:PHP

PHP安装 AMQP扩展

AMQP扩展能够支持rabbitMQ,AMQP是rabbitMQ的协议(Advanced Message Queue Protocol 高级消息队列协议)这个可自行百度。

继续阅读

PSR规范标准

参考文档:https://github.com/hfcorriez/fig-standards/tree/zh_CN/接受

是PHP Standard Recommendation的简写,它其实应该叫PSRs,即系列推荐标准:目前通过的规范有PSR-0(Autoloading Standard)、PSR-1(Basic Coding Standard)、PSR-2(Coding Style Guide)、PSR-3(Logger Interface)、PSR-4(Improved Autoloading)。它不是PHP官方标准,而是从如Zend、Symfony2等知名PHP项目中提炼出来的一系列标准,目前有越来有多的社区项目加入成员并遵循该标准。

继续阅读

PHP7中的MongoDB\Driver\WriteConcern

这个是个对mongodb的写入性能、以及确保数据一致性的控制设置,非常重要的一个类

1、final public MongoDB\Driver\WriteConcern::__construct ( string|int $w [, integer $wtimeout [, boolean $journal ]] )

参数:$w
1:默认的writeConcern,数据写入到Primary就向客户端发送确认
0:对客户端的写入不需要发送任何确认,适用于性能要求高,但不关注正确性的场景

继续阅读

PHP7中的MongoDB\Driver\Manager

这个MongoDB中的操作入口类,包括了连接MongoDB服务器、write、query的操作.

final public MongoDB\Driver\Manager::__construct ( string $uri [, array $options [, array $driverOptions ]] )

继续阅读

PHP7中MongoDB\Driver\BulkWrite

这个类可以理解为是一个搜集类,从类名中也可以提现,bulk在有道中的释义“使扩大”。该类可以将insert(写)、update(更新)、delete(删除)的多条操作收集后,发送给
MongoDB\Driver\Manager::executeBulkWrite()使用。

继续阅读

php7的安装以及编译中的错误

1、下载地址:http://php.net/downloads.php

2、configure的配置如下:

./configure –prefix=/usr/local/php7 -with-config-file-path=/usr/local/php7/etc -with-mcrypt=/usr/local/libmcrypt -with-mysqli=mysqlnd -with-pdo-mysql=mysqlnd -with-gd -with-iconv -with-zlib -enable-xml -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -enable-mbregex -enable-fpm -enable-mbstring -enable-ftp -enable-gd-native-ttf -with-openssl -enable-pcntl -enable-sockets -with-xmlrpc -enable-zip -enable-soap -without-pear -with-gettext -enable-session -with-curl -with-jpeg-dir -with-freetype-dir -enable-opcache –with-readline

编译PHP8:

./configure –prefix=/usr/local/php8 –with-config-file-path=/usr/local/php8/etc –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd –with-iconv –with-zlib –enable-xml –enable-bcmath –enable-shmop –enable-sysvsem –enable-mbregex –enable-fpm –enable-mbstring –enable-ftp –with-openssl –enable-pcntl –enable-sockets –enable-soap –without-pear –with-gettext –enable-session –with-curl –enable-opcache –with-readline –enable-cgi
–enable-pdo –with-mhash

继续阅读

卸载php5

1、查看已安装的PHP

rpm -qa | grep php

2、使用rpm -e  逐个删除