很遗憾,我无法解决Class 'MongoPool' not found
错误。重新检查配置中的所有内容,一切看起来都很正常:(已花了4个小时就已经:(
我正在使用:
配置信息:
php文件夹中的mongo.ini就是这个
extension=mongo.so
mongo.native_long = true
mongo.utf8 = 1
/etc/php5/fpm/pool.d/www.conf也很短
[www]
user = www-data
group = www-data
listen = /var/run/php-fpm.sock
pm = dynamic
pm.max_children = 10
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 6
access.log = /var/www/log/$pool.access.log
;chroot = /var/www/
chdir = /
你能看一下我的配置并帮助我吗?
测试页面是这个
<?php
MongoPool::setSize(2);
?>
nginx服务器的配置是
server {
root /usr/share/nginx/www;
index index.php index.html index.htm;
server_name localhost 192.168.1.149;
location / {
try_files $uri $uri/ /index.html;
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
deny all;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
来自nginx的日志片段
2012/10/21 06:35:48 [error] 21418#0: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'MongoPool' not found in /usr/share/nginx/www/test2.php on line 2
PHP message: PHP Stack trace:
PHP message: PHP 1. {main}() /usr/share/nginx/www/test2.php:0" while reading response header from upstream, client: 192.168.1.2, server: localhost, request: "GET /test2.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "192.168.1.149"
答案 0 :(得分:1)
正如用户 eicto 暗示,MongoDb Driver for PHP的创建者大约2个月前从驱动程序的主干版本中删除了此类(请参阅 this commit 强>)。
我们将添加MongoPool和其他几种方法以实现向后兼容,但他们不会做任何事情而只是发出E_DEPRECATED警告
使用开发版本时要小心。