不幸的是,我无法修复Class 'MongoPool' not found
错误。重新检查了配置中的所有内容,对我来说一切看起来都很正常 :( 已经花了 4 个小时了 :(
我正在使用:
- Ubuntu 12.04
- nginx 1.1.19
- php 5.3.10-1ubuntu3.4 作为 nginx 的 php-fpm 扩展
- mongodb驱动1.3.0RC1-dev
配置信息:
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"