0

I am attempting to configure PHP and Mongo DB to connect with one another and I'm having some troubles. Before I say the problem let me recap what I have so far.

I am using MAC OS X 10.6.8

I have mongo DB installed and working stand-alone.

I have enabled PHP on the default Mac OS Apache web server. It is working and the server recognizes PHP ( it is not allowing inline PHP scripts in HTML files...not sure if this an issue)

"Web sharing" works just fine.

I have installed pear via this url: curl -O http://pear.php.net/go-pear.phar

I have the pear folder and files accessible and have launched o-pear.php from a web browser.

I have gone through the step-by-step install process ( and removed any red displayed errors ).

Presumably Pear is now installed.

It says at the bottom of the install front end:

Note: To use PEAR without any problems you need to add your PEAR Installation path (/Users/myname/Sites/PEAR) to your include_path.

Using a .htaccess file or directly edit httpd.conf would be working solutions for Apache running servers, too.

I am not sure what the code is I need to add for the httaccess rewrite.

As of this moment Terminal does not recognize the pear command. When I launch the pear "front end" from a web browser I get:

Fatal error: No PEAR.php in supplied PEAR directory: /Users/myname/Sites/PEAR in /Users/myname/Sites/index.php on line 24

Thank you. That is all.

William
  • 4,422
  • 17
  • 55
  • 108

1 Answers1

0

Create a new PHP file called phpinfo.php. Add the content <?php phpinfo(); ?> there. Run the script from within your webbrowser.

You should see a big page with PHP configuration information. Watch out for include_path. This is where your webserver/PHP module/process searches for include files.

You will also find Loaded Configuration File. This is the PHP configuration file being used. Open that file in any editor, and search for include_path again. Add /Users/myname/Sites/PEAR to the end of the include_path.

Restart your webserver. PEAR now should work.

If you need to install the MongoDB PHP extension, go for pecl install mongo from command line.

Shi
  • 4,178
  • 1
  • 26
  • 31
  • The include path is: .:/usr/lib/php The Loaded Configuration File directory is (none). Not sure what to do. Should I manually create this file? – William May 17 '13 at 04:57