Error enabling MongoDB module - php

I am trying to use MongoDB with drupal 7 site. The database is hosted remotely on mongolab.com.
I have installed the MongoDB Driver on my dedicated server and it added extension = "mongo.so" to my php.ini automatically.
Now, when I try to enable MongoDB module, it gives me this error:
Mongodb requires the PHP MongoDB extension to be installed. (Currently using Mongodb Not found)
Any ideas why?

1) In your phpinfo() screen, make sure the Configuration file Path and Loaded Configuration File match the PHP file you are editing. If not, then find the correct php.ini and add the mongo.so extension.
2) In your phpinfo() screen, look at the extension_dir value and confirm that mongo.so exists in that directory. If not, find the mongo.so file and copy it to this directory.
3) Restart your web server.
4) If it's still not working, take a look at the web server & php logs for clues as to why the extension might not be loading.

Related

How to edit php.ini file and add extensions to 123-reg site?

I need to install the sqlsrv driver to a php site hosted on 123-reg. when I load up the website it only says: "Failed to get DB handle: could not find driver"
I can see on phpinfo() that the php.ini file is stored in a folder called etc that I can't seem to find anywhere. The file path is "/etc/php72.ini.d/php.ini"
I also need to copy over the drivers into the extension folder which I can't seem to find either.
How can I find php.ini or create a new one and use that. And how can I install drivers to 123 reg?
I'm using php 7.2.
Any help would be appreciated!

PHP SOAP extension not working (PHP + IIS + SOAP Extension)

I'm having some issues trying to achieve a SOAP request to a web service by using PHP.
I have a really small project which only send some requests of a SOAP web service, parses them and show the results on a table, but it's not working. I've developed this using XAMPP and this is the very first time I deploy something on a IIS web server so I'm a newbie.
I'm not using any framework, it's just plain PHP.
The first problem I have is that php_soap.dll extension seems to be disabled since I check the configuration with php_info(); and I can't find SOAP extension in the result, but I've enabled it in my php.ini by removing the semicolon from that line and my extension folder is "ext" under my PHP folder. I have some other extensions running and they're just fine.
Doing some var_dump when I try to instatiate the SOAP class, it's not returning anything (not even null).
Some more info:
PHP Version: 7.3.25
IIS Version: 10.0.17763.1 running on Windows Server 2019
2022-09-05 Edit
I've found out that php_openssl.dll isn't working on my server. I don't know why. It's enbled in php.ini. However, phpinfo(); shows it as disabled.
On the other hand, when I run "php -m" command on my CMD, it shows that SOAP and OpenSSL are enabled:
The first thing you need to do is enable the php_soap extension in your php.ini file. You can do this by removing the semicolon from the line that says ;extension=php_soap.dll. Once you have done this, restart your web server.
Next, you need to make sure that the extension_dir setting in your php.ini file points to the directory where your PHP extensions are located. For example, if your extensions are in the c:\php\ext directory, then your extension_dir setting should look like this:
extension_dir = "c:\php\ext"
Once you have done this, restart your web server.
If you still cannot get the SOAP extension to work, please post a comment below and I will try to help you further.
I already solved my problem.
The problem was not in the PHP.ini file, that one was correctly configured.
The problem was that I hadn't installed an extension for PHP and IIS. Once I've installed PHP Manager For IIS and configured it by following this tutorial, it worked out correctly.

Wamp Server 2.2 not working after enabling a PHP Extension

I've been working on Wamp Server 2.2 . Everything is ok but when I tried to enable a PHP Extension from the icon tray then Apache won't work anymore. Unless I re-install it then it will work. But I need to enable some PHP Extensions like curl and postgre pdo for my project.
I also tried manually editing the php.ini to enable php extensions, still wamp server apache won't work. Any ideas?
Just enabling a php extension from wamp does not work sometimes because if there is no extension for that module in the php's extension folder then wamp will either stop working or might give out some windows pop up error message when you start wamp.
So please check if those modules exists in the extension directory of your php's root folder.
I hope this helps you.
WAMPServer has more than one php.ini file and it is easy for beginners to get confused.
The safest way to edit the Correct php.ini file is to use the wampmanager.exe menu links
left click wampmanager -> PHP -> php.ini
This will edit the \wamp\bin\apache\apache{version}\bin\php.ini file, which is the correct one for effecting php changes for the PHP used on your web site.
The menu links should also work to activate/deactivate PHP extensions as follows :-
wampmanager -> PHP -> PHP Extensions -> click an extension
If the extension has a TICK then it is activated, if not then it is not activated. Each time you click on an extensions name, it will restart Apache to action the activation or deactivation of that extension, so give it a few seconds to complete this restart before checking it worked.
There is also a php.ini file in the \wamp\bin\php\php{version} folder, however this file is only used by the PHP CLI ( Command Line Interface ) so if you chnage this it will have no effect on the php used by Apache.

GD2 library in PHP not installing

I'm having problems installing the GD library. I'm using an IIS server with PHP 5.2.14. I uncommented extension=php_gd2.dll in php.ini.
This is the error:
gd: Unable to initialize module
Module compiled with module API =20060613
PHP compiled with modlule API = 20090626
These options need to match
in Unknown on Line 0
I downloaded various PHP versions to try and get the correct DLL, including thread-safe 5.2.14. I would then restart my application pool and try to load a file that uses the GD library. Are there other files necessary for gd2 to work? Are there any quick ways to solve this without reinstalling PHP entirely?
first, iis7 was not configured properly for php - I searched for a guide that walked me through. Second the directory was incorrect, whenever I reset the iis server it originally would say one directory when ISAPI api was being used- but after 2 mins it would say extension_dir was in another directory when cgi/fastcgi is being used. So i created that directory that it wanted (which was different than any of my php.ini's). The one it was pulling from needed to be put in the C:/windows directory, but even though I had it set to go to "./ext" it wanted to go to Program files/PHP-- extremely weird. Third, I had to add IUSR to the permissions of any folder being used.

MySQL not working with php; and crashing apache when enabled

I just recently setup a fresh install of PHP, Mysql and Apache on my Windows 2003 server. Php is working fine and my Navicat MySQL browser can connect to my tables. However no matter what I do. MySQL doesn't show in phpInfo() even though I have the extensions in my ext folder. I installed PHP via the windows binary installer. Any idea what I'm missing? I'm pretty new to PHP is this is the first time I've tried to setup my own server I'm sure I'm missing something simple. Thanks.
--- EDIT ---
So as suggested by Alan Geleynse I added the extension to my php.ini, now Apache crashes every time I try to enable php_mysql.dll any ideas on this one? I may just restart my php from scratch if this is any more trouble.
You probably need to enable the extension in your php.ini
Search through php.ini for extension and you should see a list, some of which will be commented out. If you remove the comment for MySQL, it should load the extension.
If you do not see it, you should be able to add this line to your php.ini. Make sure that the dll listed is the one you want and is located in your extension directory.
extension=mysql.dll
Seems the issue was not only a missing php_mysql.dll but I was also missing libmysql.dll The installer still borked the install of the extension files though. Oh well it happens thanks to everyone for the help.
Probably apache crashes because of missing dll. There is probably a directory 'ext' in your php installation dir. Check whether there is a 'php_mysql.dll' file in it.
Also, check for directive 'extension_dir' in your php.ini, it must point to the location of extensions directory. For example, I have php installed in 'C:\php' and 'C:\php\ext' folder in it. My php.ini contains line:
extension_dir = "C:/php/ext"
I just fixed this problem on my computer by copying libMysql.dll from the MySql server directory to c:/windows/system32/, just a few minutes ago.

Categories