0
votes

Unfortunately I'm unable to fix Class 'MongoPool' not found error. Rechecked everything in configs and everything looks normal to me :( Spent 4 hours on this already :(

I'm using:

  • Ubuntu 12.04
  • nginx 1.1.19
  • php 5.3.10-1ubuntu3.4 as php-fpm extension to nginx
  • mongodb driver 1.3.0RC1-dev

Configuration info:

  • my phpinfo() output is here
  • nginx.conf is here
  • fastcgi_params is here
  • php.ini is here
  • php-fpm.conf is here

mongo.ini in php folder is this

extension=mongo.so
mongo.native_long = true
mongo.utf8 = 1

/etc/php5/fpm/pool.d/www.conf is pretty short too

[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 = /

Could you please take a look at my configs and help me ?

Test page is this

<?php
MongoPool::setSize(2);
?>

nginx server's config is

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;
        }
}

Log snippet from 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"
1
check output of print_r(get_declared_classes()); - zb'
@eicto, sh*t, they removed it ! and didn't say that in documentation ! thank you, thank you!! - expert
mongodb driver 1.3.0RC1-dev - take care when using development versions. - hakre

1 Answers

1
votes

As user eicto hinted above creators of MongoDb Driver for PHP removed this class from trunk version of the driver about 2 months ago (see this commit).

We will be adding back MongoPool and couple of the other methods for backwards compatibility, but they won't do anything and just issue E_DEPRECATED warning

Take care when using development versions.