PHP fatal error: uncaught exception 'mongoonexception' with message 'permi

Source: Internet
Author: User

Reposted fromHttp://www.michaeltozzo.com/blog/2010/02/19/mongodb-php-problem/

While at work I was looking into something that we cocould replace MySQL with since the two trends these days are to not do any joins between tables and to work with large datasets. I Came login ss a database called MongoDB which was apparently very good at both of these things and used guides on the Internet to get it going on a local Linux box.

I got to a point where it was almost working 100% but for some reason my simple test script couldn't connect when run by Apache but cocould when run via command line. I wocould get the error:

PHP fatal error: uncaught exception 'lost connectionexception' with message 'permission denied'

I scoured the Internet and found only a single reference to my problem but couldn't find a solution. after direct emails with Kristina chodorow the primary maintainer for the MongoDB Perl and PHP drivers I found that the solution to my problem was to run the command:

$/Usr/sbin/setsebool-P httpd_can_network_connect 1

Hopefully this helps someone else. Thanks again Kristina.

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.