I have an issue with connecting php(valet) and MongoDB. I tried to install MongoDB with pecl and command sudo pecl install mongodb and brew install mongodb and all time I get some errors during the install process:
In file included from /private/tmp/pear/temp/mongodb/src/MongoDB/Cursor.c:18: /opt/homebrew/Cellar/php#8.0/8.0.17/include/php/ext/spl/spl_iterators.h:151:4: error: unknown type name 'pcre_cache_entry' pcre_cache_entry *pce; ^ 1 error generated. make: *** [src/MongoDB/Cursor.lo] Error 1 ERROR: make' failed`.
But when I run mongo --version I get:
and I install MongoDB Compass and as you can see, I can connect to the database and write into it:
But when I try out to install laravel package jenssegers/mongodb I get these errors: I tried with --ignore-platform-req=ext-mongodb flag but then it install package but it didn't work, I get this error: Error: Class "MongoDB\Driver\Manager" not found.
Finally, I find out a great package that helps me in this! This repo saves me a ton of time and debugging! Thank you shivammathur!
Hey I also had the same problem. A good alternative is to also follow with this article if you want to stick with pecl https://freek.dev/2151-fixing-the-dreaded-pcre2h-file-not-found-error-when-installing-imagick
Related
When I am trying to intall Laravel to Ubuntu with the following command:
composer global require "laravel/installer"
I get the following error (see following image)
When I run:
php --ini
I get the following output (see following image)
I really cannot see what the problem is, all help i appreciated.
Thanks
I will give you one small tip, whenever any error occurs, kindly try reading through it.
As it says requires ext-zip that means it is require extension ZIP installed to perform required operation.
So all you need to do as of now is to install ZIP extension for php using this command
sudo apt-get install php7.0-zip
I want to use Mongo DB with php, so for that I have installed the driver and its showing here as well in phpinfo()
The problem is when I try to connect it, I get Fatal error.
Fatal error: Uncaught Error: Class 'MongoDB\Client' not found
Here is how I am connecting
$mongo = new \MongoDB\Client('mongodb://user:xxx!#00.00.00.00/chat');
try
{
$dbs = $mongo->listDatabases();
print_r($dbs);
}
Here is how I installed extension sudo apt-get install php7.0-mongodb
Also I followed this http://php.net/manual/en/mongodb.tutorial.library.php
Any help!
\MongoDB\Client belongs to the mongo-php-library which is different from mongo-php-driver
in another words, the library is using the driver,
so after installing the mongo-php-driver you need to perform another operation by installing the library using composer
composer require mongodb/mongodb
or even by cloning it from github
git clone https://github.com/mongodb/mongo-php-library.git
I tried to install zend framework 2 on Ubuntu 12.04.1 64 bit but have run into difficulties.
# sudo pyrus install zf2/Zend_Framework-beta#Standard
failed mid transaction with no other previous errors that I can recall other than warnings about timezone not being set. ( Unfortuantely my terminal history has lost the original output)
Pyrus\Installer\Exception: Installation failed
Pyrus\AtomicFileTransaction\MultiException: ERROR: commit failed
Pyrus\IOException: CRITICAL - unable to complete transaction, rename of actual to backup path failed
Pyrus\AtomicFileTransaction\RuntimeException: Cannot rollback - not in a transaction
Now when I try to rerun
# sudo pyrus install -f zf2/Zend_Framework-beta#Standard
it fails with
Pyrus\Registry\Exception: Cannot retrieve package file object for package packages.zendframework.com/zend_framework, it is not installed
Uninstall just tells me that it's not installed.
I restored /usr/share/.old-php to /usr/share/php however I still get the same error.
Please help.
You can just try to download and unzip Zend Framework 2 archive into your project's library folder.
It looks like it's a problem with the metapackage according the Matthew. I'm having the same problem.
Error Installing full framework with Pyrus
So if I installed pyrus here: "/usr/share/pear/pyrus" , then should I create a directory "/usr/share/pear/pyrus/zf2" and download and unzip the full Zend Framework in zf2 and it should work?
thanks
I am trying to install on my local machine the following project connect which is using symfony2.
I did perform the following commands:
cd myWebDirectory
git clone git://github.com/dsyph3r/connect
git submodule update --init
When I try to call the following page from my localhost I get the following error:
http://localhost/~myName/connect/web/app_dev.php
Server error
If I look to the logs file of apache I read:
PHP Fatal error: require_once():
Failed opening require
'/Users/myName/Sites/connect/app/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php'
How should I install the vendor?
What I did miss?
You forgot to install the vendor ("third party") libraries.
php bin/vendor install
Update: It's a while ago, since I wrote this and it's not valid anymore (for new(er) projects). Since 2.1 it uses Composer
php composer.phar install
I've been trying to set up ninjauth but see to have run into a problem for some reason fuel doesn't seem to be recognizing the oauth package correctly and I am getting the following error
ErrorException [ Error ]: Class 'OAuth\Fuel' not found
PKGPATH/oauth/classes/request.php # line 477
I have made sure the package is installed in /fuel/packages/oauth
added it to the config file in /fuel/app/config/config.php so it looks like
'packages' => array(
'orm','ninjauth','oauth','oauth2','auth'
),
and ran a migration on it
php oil refine migrate --packages=oauth
I am developing locally on OSX(10.5.8) using MAMP as my server if that helps.
this was a namespace issue and has been fixed in this commit
https://github.com/fuel-packages/fuel-oauth/commit/57da924ffcd1f9d08fe3f2d40e4b35b0a92d8c94
I was having the same trouble and it turns out I did not have cURL as part of my php installation.
I corrected the issue on Linux by running: sudo apt-get install curl libcurl3 libcurl3-dev php5-curl