I need help installing the driver so I can use the mongo database in php.
This is what I have done so far:
I installed php and am using the built in webserver
I installed mongodb
I added the driver from https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
in to my ext php folder
I added
[Mongo]
extension=php_mongo.dll
in my php.ini file
I did everything right, but it will not load the module.
did I miss something?
I found it is not loading it because phpinfo() does not show it.
Maybe you are using the wrong extension on the mongodb driver, you could check that in here to see wich version of mongodb driver correspond to your PHP version, once you've done that, if you're using windows, you need to tell PHP to use the extension modifying the php.ini file adding the extension like this
Finally you'll need to restart your web server (apache or nginx) so you can use that extension, you verify that making a file with phpinfo(); in it and it should show something like this, if it does then you're ready to go
Related
Hy! I'm trying to use oci on windows, I found some linked issues, but I don't have any xampp, or apache, or anything, I'm only using the php built-in server. I enabled the oci extension in the php.ini file, but it does not work. I was looking for answer. I don't need any oracle database, there is a database, I only want to connect it with my app. I have the error above every time, when I'm trying to run any php command. So it does not work. The missing dll file is there, so I don't understand, why is it missing. I installed pear, and pecl, but pecl installations need openssl, openssl needs visualC++ and some other things... is there any other solution? Even though why does it not find that dll, if it's there... I downloaded Oracle Instant client and Oracle SDK, I unzipped it, set the environmental variables, but nothing changed... Please, help!
You need to download the correct oci8_19.dll if not already there and placed it under your_xampp_directory\php\ext folder.
Enable/add this extension in your php.ini file.
Add environment variable path for PHP.
Then, you also need Oracle Instant client to load/run this properly. Download it from here. Be mindful about x86 or x64 architecture of your windows machine and download the one that matches your machine specs.
Add this Oracle instant client path too in your environment variable.
Restart command prompt and type php -v. Voila! It runs smoothly and shows you just the PHP version, which means your oci extension loaded properly.
I am upgrading my Ubuntu server and installing latest version of PHP i.e PHP 7.0.18, MongoDB 3.2.14, CodeIgniter v 2.2. Now when I am trying to connect with Mongo through CodeIgniter I am getting error as:
The MongoDB PECL extension has not been installed or enabled.
Kindly help. Kindly note my MongoDB and app are in two different instances. From app instance through CLI I can access the MongoDB but through CodeIgniter I am not able to.
Actually I am not able to update the lib file which I am using as per the updated versions.
Thanks.
Go to php.ini and search for the extension and pass the proper extension path like:
extension="/usr/lib/php/extensions/no-debug-non-zts-20100525/mongo.so"
uncomment it by removing the ; from the starting and restart the apache and try again.
Im on Windows 7, 64/bit running xampp v3.1. The php version is 5.4, Im trying to install memcache locally on the box so I can use memcache with php. I have searched google and followed directions about installing memcached.exe as a service, then downloading the memcache dll extension file for php and putting it into the ext folder under the php folder. I then add it to the php.ini folder, restart apache and memcache does not show up when running phpinfo() and when I try to run memcache via php it tells me this function does not exist. Can anyone help me figure this out? I verified the service is up and running, I tried different versions of the dll php extension file but still same issue. Any suggestions? Here is one site I used for instructions on installing memcache:
http://shikii.net/blog/installing-memcached-for-php-5-3-on-windows-7/
There must be some error logged into your apache logs. What is the error?
Looks like I grabbed the incorrect version of memcache for php. You must grab the correct memcache dll file for the php version you are using. I found the correct download here:
http://windows.php.net/downloads/pecl/snaps/memcache/3.0.6/php_memcache-3.0.6-5.4-ts-vc9-x86.zip
It has the correct php version, 5.4 and its thread safe. Once I downloaded it, extracted the dll and put into php extension folder and restarted xampp/apache, it now works.
I have a php project developed using zend framework, when i hosted to my local server(CentOS) i got the
below error:
The mysql driver is not currently installed
I have installed and enabled pdo_mysql on php.ini, but it is not effected my phpinfo.
Phpinfo only show pdo_sqlite not see pdo_mysql.
Another issue in my machine is phpinfo shows PHP version 5.2.8 and from terminal it shows PHP 5.1.6. Are there two php version running my machine?
Help is highly appreciated.
Check your phpinfo() output for the location of the php.ini file used and make sure to adapt that file. It's perfectly possible to have multiple versions of php running on a single computer.
It will show near the top of the output as (here's mine):
Loaded Configuration File /etc/php5/apache2filter/php.ini
that would be the location of the file you need to edit to affect your webserver instance php behaviour.
make sure to extension=php_pdo_mysql.so in it to load the mysql pdo driver
finally also make sure that extension_dir points to the directory where your libraries are found, using an absolute path; you can find that in phpinfo() under Core (and in your php.ini when you want to adapt it obviously)
I have a Windows Vista PC with IIS7, I have managed to manually install PHP on it.
And managed to load one of my custom extension for PHP, as well as mbstring extension.
But my mysql extension does not load when I check through phpinfo, I checked all the path variable, uncommented requied lines in php.ini file, also verified that the file exists.
My question is, does it require mysql server to be working on the local host for the mysql extension to load? or what could be wrong?
No, but you do need the appropriate MySQL client libraries to be available.
No, php_mysql.dll simply adds the various mysql functions into PHP. How could the .dll know where your server is? Or how you connect to it? Or what if you've got multiple seperate servers?
Until you actually try to connect to the server, the .dll will happily stay idle and not do anything.
If you're not stuck with using IIS, you could investigate installing WAMP - that'll give you MySQL, PHP, and Apache with a nice unified installer, without forcing you to mess around with .dll installation/customization.