Phpstorm cannot use MongoDB based on MAXP in Mac system End method

Source: Internet
Author: User
Tags install mongodb macbook
A day's finishing, for reference only!

$a = New Mongo () ;The above code executes with an error, as follows:

Fatal Error : Class ' Mongo ' not found in /users/mfw/phpstormprojects/keensting/control/exprement.php on line -

I installed the MAMP integrated development environment

The configuration in Phpstorm is as follows


Looked for a long time to find that the PHP Mamp is not extended MongoDB features, the system comes with PHP I ran into MongoDB but because of the lack of php-cgi, so there is no egg use--web direct input localhost : 27017 can be connected to the Mac with the extension of PHP MONGO, and Phpstorm function Mamp,mamp no MONGO, so he will be loaded

Start installation

1, here to use the brew installation, no can go to degree Niang find homebrew installation tutorial, relatively fast, but need Xcode support, not to applestore down a bar, free, install need to start once and then quit


2, install MongoDB (requires root console input sudo-s, enter the password can be entered)

bash-3.2#/applications/mamp/bin/php/php5.6.10/bin/pecl Install MONGO

result Error

Downloading mongo-1.6.10.tgz ...
Starting to download mongo-1.6.10.tgz (209,087 bytes)
... done:209,087 bytes, .........---------------.....????
118 Source files, building
Running:phpize
grep:/applications/mamp/bin/php/php5.6.10/include/php/main/php.h:no such file or directory
grep:/applications/mamp/bin/php/php5.6.10/include/php/zend/zend_modules.h:no such file or directory
grep:/applications/mamp/bin/php/php5.6.10/include/php/zend/zend_extensions.h:no such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Cannot find autoconf. Please check your autoconf installation and the
$PHP _autoconf environment variable. Then, rerun the this script.

ERROR: ' phpize ' failed

3. Locate the Include folder (soft connection, associated folder)

bash-3.2# sudo ln-s/applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/ Macosx10.9.sdk/usr/include/applications/mamp/bin/php/php5.6.10/include

Run again

The result is still a problem.

bash-3.2#/applications/mamp/bin/php/php5.6.10/bin/pecl Install MONGO

Downloading mongo-1.6.10.tgz ...
Starting to download mongo-1.6.10.tgz (209,087 bytes)
... done:209,087 bytes, .........---------------.....????
118 Source files, building
Running:phpize
Configuring for:
PHP Api version:20100412
Zend Module Api no:20100525
Zend Extension Api no:220100525
Cannot find autoconf. Please check your autoconf installation and the

$PHP _autoconf environment variable. Then, rerun the this script.

ERROR: ' phpize ' failed

4, said to be unable to find AutoConfig, then installs!! (This is to exit the root state)

keenstings-macbook-pro:~ mfw$ Brew Install autoconf
Warning : You have an outdated version Of/usr/bin/install_name_tool installed.
This would cause binary package installations to fail.
This can happen if you install Osx-gcc-installer or Railsinstaller.
To restore it, you must reinstall OS X or restore the binary from
The OS packages.
==> Downloading Https://homebrew.bintray.com/bottles/autoconf-2.69.yosemite.bott
######################################################################## 100%
==> Pouring autoconf-2.69.yosemite.bottle.1.tar.gz

?/usr/local/cellar/autoconf/2.69:70 files, 3.1M


5, the installation is finished execution

keenstings-macbook-pro:~ mfw$ sudo/applications/mamp/bin/php/php5.6.10/bin/pecl install MONGO

Tips

Password:
Downloading mongo-1.6.10.tgz ...
Starting to download mongo-1.6.10.tgz (209,087 bytes)
... done:209,087 bytes, ........--------------.....???
118 Source files, building
Running:phpize
Configuring for:
PHP Api version:20100412
Zend Module Api no:20100525
Zend Extension Api no:220100525

Build with Cyrus SASL (MongoDB Enterprise authentication) support? [No]

6, enter Yes to return.

a long hint of information

and Finally, this .

Build Process completed successfully
Installing '/applications/mamp/bin/php/php5.6.10/lib/php/extensions/no-debug-non-zts-20131226/mongo.so '
Install ok:channel://pecl.php.net/mongo-1.6.10
Configuration option "Php_ini" is not a set to php.ini location
You should add "extension=mongo.so" to PHP.ini

keenstings-macbook-pro:~ mfw$

7, go to your place. Add extension=mongo.so to PHP.ini

look at the tutorial on the back, but I looked for a day of information = =


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The above describes the Mac system Phpstorm can not be based on MAXP using MongoDB, including the contents of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.