我无法安装mongodb php56 osx

时间:2016-11-24 15:31:54

标签: apache

我尝试为PHP56安装MongoDB,但我不能......我找不到" mongo"在我的phpinfo();并没有找到班级。

# [INFORMATIONS]
MongoDB run in my mac
PHP 5.6.4
OSX 10.12.1-x86_64 (Sierra)
Homebrew 1.1.1
Java 1.8.0_101
Xcode 8.1


# [COMMANDS INSTALL]

$ brew update

$ brew tap homebrew/php (i try without)

$ brew install php56-mongodb
==> Installing php56-mongodb from homebrew/php
==> Downloading https://homebrew.bintray.com/bottles-php/php56-mongodb-1.1.9.sierra.bottle.ta
Already downloaded: /Users/cedric/Library/Caches/Homebrew/php56-mongodb-1.1.9.sierra.bottle.tar.gz
==> Pouring php56-mongodb-1.1.9.sierra.bottle.tar.gz
==> Caveats
To finish installing mongodb for PHP 5.6:
  * /usr/local/etc/php/5.6/conf.d/ext-mongodb.ini was created,
    do not forget to remove it upon extension removal.
  * Validate installation via one of the following methods:
  *
  * Using PHP from a webserver:
  * - Restart your webserver.
  * - Write a PHP page that calls "phpinfo();"
  * - Load it in a browser and look for the info on the mongodb module.
  * - If you see it, you have been successful!
  *
  * Using PHP from the command line:
  * - Run `php -i "(command-line 'phpinfo()')"`
  * - Look for the info on the mongodb module.
  * - If you see it, you have been successful!
==> Summary
 /usr/local/Cellar/php56-mongodb/1.1.9: 3 files, 562.0K

$ sudo apachectl -k restart
AH00557: httpd: apr_sockaddr_info_get() failed for XXXXXXX.local
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

$ php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/5.6
Loaded Configuration File:         /usr/local/etc/php/5.6/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.6/conf.d
Additional .ini files parsed:      /usr/local/etc/php/5.6/conf.d/ext-mongodb.ini

$ php -i | grep "mongo"
Additional .ini files parsed => /usr/local/etc/php/5.6/conf.d/ext-mongodb.ini
PHP Warning:  Unknown: 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
mongodb
mongodb support => enabled
mongodb version => 1.1.9
mongodb stability => stable
libmongoc version => 1.3.6
mongodb.debug => no value => no value
PATH => /opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mongodb/bin
_SERVER["PATH"] => /opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mongodb/bin

编辑[解决方案]:

OSX使用不同的php文件夹,我的apache使用不同的文件夹到php命令行工具......我在/etc/php.ini添加了extension="/usr/local/opt/php56-mongodb/mongodb.so"

0 个答案:

没有答案