2

I just installed RockMongo by extracting all the files to a lampp web folder /opt/lampp/htdocs/rockMongo/. Visiting index.php shows

To make things right, you must install php_mongo module. Here for installation documents on PHP.net.

I followed the instructions there (I had to install php-pear):

  • sudo pecl install mongo
  • Add the following line to php.ini: extension=mongo.so

Now, when I start the web server (apache), I get the following warning, repeated hundreds of times:

Warning: PHP Startup: It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in Unknown on line 0

and also this warning a single time:

Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/mongo.so' - /usr/lib/php5/20090626/mongo.so: wrong ELF class: ELFCLASS64 in Unknown on line 0

The index page stills shows the same message (which means that class_exists("Mongo") returns false)

I tried putting in the absolute path to mongo.so, but that didn't do anything. What's going on?

edit: I used

$ file /usr/bin/php5
/usr/bin/php5: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

which seems to suggest my php installation is 64 bits, yet when I print out PHP_INT_MAX I get 2147483647 which seems to indicate my installation is 32 bits. How can I know the "bitness" of my php installation?

Shawn
  • 10,931
  • 18
  • 81
  • 126

1 Answers1

0

From the second PHP warning, it looks like you've mixed 32bit code and a 64bit library.

Make sure all the stuff you've downloaded is of the same "bitness" as your PHP installation.

Mat
  • 202,337
  • 40
  • 393
  • 406
  • Does that ELF class mean that mongo.so is 64 bits? I'm still trying to figure out whether my lampp installation is 64 bits, can't quite figure it out yet. – Shawn Sep 20 '11 at 20:35
  • Find the `php` executable and run `file /path/to/php`. It will tell you if it's 32bit or 64bit. The `mongo.so` file does appear to be a 64bit ELF. – Mat Sep 20 '11 at 20:39
  • $ file /usr/bin/php5 -> /usr/bin/php5: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped – Shawn Sep 20 '11 at 20:45
  • Both PHP5 and mongo.so seem to be 64 bits – Shawn Sep 20 '11 at 20:47
  • Do you have any other files in /usr/lib/php5/20090626? Is your LAMP not using a php interpreter installed in /opt/lamp? – Mat Sep 20 '11 at 20:55
  • I also have /usr/lib/php5/20090626/pdo.so but I don't need it. Would it help to delete it? I don't know about a php interpreted in /opt/lampp.. /opt/lampp contains the following: backup bin cgi-bin error etc htdocs icons lampp lib libexec licenses logs modules phpmyadmin phpsqliteadmin RELEASENOTES sbin share tmp var – Shawn Sep 20 '11 at 21:02
  • Look at the "bitness" of the files inside `lib` and `libexec`, and at what's in `lampp`. Look at the bitness of that `pdo.so`. Look at other files/directories under /usr/lib*/php5. – Mat Sep 20 '11 at 21:05
  • How can I check the "bitness" of files? – Shawn Sep 21 '11 at 23:05
  • Ok, now I'm confused about the "bitness" of my php installation, see my edit. – Shawn Sep 22 '11 at 02:21