Loading PHP MongoDB class with XAMPP on Windows 7 - php

Okay.
I'm trying to use MongoDB with Node.js and PHP/XAMPP on Windows 7, but I can't seem to install the PHP MongoClient Class at all.
I am a complete beginner with MongoDB and I have to say that if I wasn't committed to solving this I'd have given up by now.
After lots of fiddling around trying to install the correct device driver version etc., I have come across yet another problem. But first, let me explain the steps I have taken so far.
Installed XAMPP v3.2.1, keeping all defaults.
Looked at phpinfo() on localhost:
PHP Version: 5.5.15. PHP Architecture: x86. Thread-Safe: Enabled.
Figured out where to download the software, as well as the correct version, etc.
Went to pecl.php.net/package/mongo/1.5.5/windows/.
At "DLL List" (PHP 5.5), I selected: `5.5 Thread Safe (TS) x86.
Went to PHP.ini (not the development or production version, but the actual one), and added 1 line: extension=php_mongo.dll. (line 887). No semicolon in front.
Started Apache.
Error: PHP Startup: C:\xampp\php\ext\php_mongo.dll could not be found on your computer.
I found out that when you manually type the file extension of a program that is already saved as a specific type, my computer simply prepends it to the existing one. The program was saved with the extension dll.dll. I got rid of that.
Restarted Apache.
Then I got this... Error: PHP Startup: Libsasl.dll is not found on your computer. Unable to load dynamic library C:\xampp\php\ext\php_mongo.dll. Try reinstalling the program.
I reinstalled the program. As I suspected, no missing file was magically created.
I then looked online to try to find this 'dll' file. After some searching, I was able to install Libsasl.dll via dll-files.com.
I restarted Apache.
Next problem:
Error: PHP Startup: Unable to load dynamic library C:\xampp\php\ext\php_mongo.dll - Access is denied.
I tried running XAMPP as an administrator. Same result.
The program is definitely there, but I can't seem to access it for whatever reason.
Why? I am getting quite frustrated with this and I would love everything to start working properly.
I have a hunch that it has something to do with read/write privileges but I don't know where to look.
Some help would be appreciated.

I was facing same issue, then after adding the path of the ".dll" file's folder to the environment variable as a system variable path, it worked. It is then able to find the file. At the end that was the only step which was stopping xampp to load the ".dll" file, although it was present in that folder. Often people miss this step as it is no where pointed out clearly.

Related

Xampp is skipping the php_grpc.dll file in ext folder. "Unable to load dynamic library 'grpc'"

I have been developing a laravel website. I have integrated google cloud firestore to it, and it required me to install and enable the grpc extension. I have been developing with it for a month now and everything is working fine. But out of nowhere, when I was about to continue the development, an error popped out when I started xampp/apache, something about vcruntime140.ddl missing from my system (i don't remember deleting anything like that, as I rarely delete things from my system). I downloaded the missing file and copied it to the required folder. Then I restarted xampp again, then it showed me this error:
Warning: PHP Startup: Unable to load dynamic library 'grpc' (tried: C:\xampp\php\ext\php_grpc.dll (The specified module could not be found), C:\xampp\php\ext\php_C:\xampp\php\ext\php_grpc.dll (The specified module could not be found)) in Unknown on
line 0.
I have scoured the internet for all the possible solutions to this. I made sure there's a php_grpc.dll in the ext folder, the grpc extension enabled in php.ini, uninstalled and reinstalled xampp, checked the accurate version, and tried different versions of the dll. But nothing still worked for me. It's as if the grpc extension dll file is invisible in the ext folder, but it's actually there. I've been stuck with this warning/error for three days now, we have a defense for this system in the following weeks but it's still isn't finished.
I am not sure where the problem comes from, but I'm sure it started when I got the error about the vcruntime140.dll file, so maybe it's related to that. I hope someone has an answer for this, it would really be helpful for me. Thank you very much!

Need help in configuring WAMP (phpMyAdmin)

So I have been looking on the net for hours now and I can't solve my problem.
I have wamp installed (WampServer Version 3.1.7 64bit).
I want to open phpMyAdmin through wamp. (I have the phpMyAdmin5.0.2 installed and phpMyAdmin.conf is configured).
I have several php versions installed.(this was done through the process of trying to fix the solution alone).
When I try to open phpMyAdmin I get this error message: [1]: https://i.stack.imgur.com/ZEMaX.png .
I have tried configuring php.ini file (by de-commenting mysqli) it didn't change a thing.
Here's my php.ini file joined in the google drive link: https://drive.google.com/file/d/1fQuVoh5vhRX-MHhYL3zMQ4xNkstO-4Ch/view?usp=sharing .
I have configured extension_dir tp the php/ext folder.
I have similary configured my windows path to the php/ext.
Nothing I try works. Any help is welcome.
Thank you.
Since you're using WAMP, which should include all the pieces you need already working, but also have several PHP versions installed, it sounds like you're installing more than you need which is causing conflicts.
Assume you have no data in your database or web pages that you need to preserve, I suggest removing everything; get rid of WAMP and any extra Apache, PHP, or MySQL/MariaDB installations you have. Clean up (delete or move out of the way) any leftover configuration files, then reinstall WAMP. If you have trouble after installing only WAMP and no other PHP installation, then report back here details of the error. WAMP should come to you working and all ready to go, so if there is a problem, it will be helpful to start from a known base installation without extra configuration files or executable that will cause conflicts.
I'll also point out that the very top of the file you posted states that it's used only for the PHP Command Line Interface, so this is not the configuration file used by anything running through your webserver (like phpMyAdmin or your site). It's a little confusing that there are really two PHP instances (one for the command line and one that runs through the webserver), but in this case you would be looking for the file in wamp/bin/apache/apache2.x.y/bin/php.ini

Loading ffmpeg-php module fails

I've been trying this for a couple of days now. I am trying to install ffmpeg-php on my CentOS server.
OS : CentOS 6
PHP : 5.5
ffmpeg : 1.2.1
ffmpeg-php : 0.6.0
The ffmpeg installation went on without a hitch and I am able to convert files back and forth via the CLI.
While installing ffmpeg-php, I encountered errors while making (after configuring) due to time.h references which was corrected by renaming the files creating with an extension .loT to .lo (as rightly pointed out here)
Once this was done, the make process went on smoothly and the make install went through without a hitch. However, after specifying the extension=ffmpeg.so in the php.ini file and after restarting Apache, the module doesn't load or show up in phpinfo().
The Apache error log shows only "PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'ffmpeg.so' in Unknown on line 0" and nothing else.
make test also shows the same error and FAILS the associated tests. I've checked here which wasn't very helpful. Also, I read somewhere that it may be the issue with permissions but the permissions for the ffmpeg.so file is 755.
Any help is appreciated.
Thanks in advance.
After looking up for hours, it seems that time.h for some apparent reason has been used in ffmpeg 1.2.1 (this is what I tested). This caused conflict with the OS's own file of the same name. This causes the installation to break in CentOS 6.x, RHEL 5.6 and RHEL 6.x
While I cannot code in PHP (and can barely read PHP code), I have found a git repo maintained by tony2001 who has made changes to the original project and using his repo has helped me install it successfully on CentOS-6.2, CentOS-6.3 and CentOS-6.4.
You can find the repo here. This seems to solve the issues in CentOS 6.x, RHEL 5.6 and RHEL 6.x.
Hope this helps anyone else trying this in the future (and maybe someone else who lands up here eventually)
PS: Incidentally, at the time of writing this answer ffmpeg 2.0 has been released but I haven't got a chance to test it yet

Cannot find php_sqlsrv extension - 5.3, threadsafe

I've followed the answer to this question to the letter:
Connection between MSSQL and PHP 5.3.5 on IIS is not working
I'm using XAMPP with threadsafe 5.3. I've copied the files to the extension directory (while leaving them in the /php folder) and I've added the extension lines:
extension=php_sqlsrv_53_ts.dll
extension=php_pdo_sqlsrv_53_ts.dll
When I do this, Apache fails to start, giving me errors in eventvwr like:
Application popup: Warning : PHP Startup: Unable to load dynamic library
'C:\xampp\php\ext\php_sqlsrv_53_ts.dll'
- The specified module could not be found.
Except, obviously, that that file DOES exist in that spot, and php.ini is pointed at that extension directory.
What's the problem?
Windows reports this when a shared lib dependency of what you're loading is missing. Use depends.exe to view the dependencies of php_sqlsrv_53_ts.dll and make sure it's either previously loaded or in the shared library search path.
http://www.dependencywalker.com/
See below url
php_sqlsrv.dll: gives error when checking PHP version but extension works
Read it:-
Since PHP 5.3, Microsoft has a new driver for windows :
http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx
Maybe you can try this version, which seems quite recent (06/2011)
Hope that helps !
Sadly, none of the answers addressed the issue or were avenues I had already explored.
I have decided to use the ODBC drivers with a SQL Server connection string, which seems to work fine, minus the fact I can't use MSSQL and SQLSRV native functions.
I have written a page that might help when installing the SQLSRV driver:
http://robsphp.blogspot.co.uk/2012/09/how-to-install-microsofts-sql-server.html
Unfortunately the instructions got complicated when MSFT removed the download for the old XP/2003 driver (version 2.0), so read the whole page before starting.
Wrong technology, but I was having problems getting WAMP to connect to MSSQL, with the same types of errors.
I fixed the problem by installing the 32-bit version of WAMP (instead of 64, even though we were on a 64-bit system).
Even if that's not applicable to the OP, I hope someone finds this helpful!
I was getting the same error messages when I started the Drupal 7 stack after installation. I am using VM Ware with Win 7 x64 and acquia-drupal-win-7.31.36-6159.54300.
I went to the PHP site http://php.net/manual/en/sqlsrv.requirements.php and installed the x64 Package.
steps
1) Stop Drupal Stack
2) run the file: sqlncli.msi
3) restart Drupal, and no error messages.

Entry Point Error when running PHP script from command line

I am trying to schedule a PHP script to run on Windows by writing a batch file. Here is the line that runs the script:
C:\Program Files (x86)\PHP>php.exe -f D:\Web\Sites\scriptPage.php
This runs the page and the results of the page process fine but it is poping up this message
"The procedure entry point zend_ini_string_ex could not be located in the dynamic link library php5.dll"
I am not sure why this is happening. We are not using Zend at all on this. I have tried this on a few different pages and the same thing happens.
Any help on this would be great.
Thanks!
I had this problem when I installed xdebug under Apache and PHP.
In your php.ini find a line that looks like this:
zend_extension_ts="c:/PHP/ext/php_xdebug-2.1.2-5.2-vc6.dll"
and comment it out.
If you do need to use xdebug make sure you have downloaded the right version of xdebug
for your php installation. I had Apache 2.2.17 with PHP 5.2.17 and I was trying to install xdebug
for PHP 5.3 which gave me extactly this error message:
*The procedure entry point zend_ini_string_ex could not be located in the dynamic link library php5.dll*
I know it's been a while since this is solved but I run into problem with the same symptoms. I have Zend Server installed on a Windows server and was trying to configure scheduled task but it was not launching
the procedure entry point php_checkuid could not be located in the dynamic limk library php5.dll
Problem was that previously I had another PHP version (standalone, not with Zend Server) installed and in Windows Environment Variables PHPRC variable was pointing to that old version of PHP. I changed this variable so it pointed to Zend Srever's PHP and everything worked.
I had a standalone version of PHP installed and then installed Zend Server. Like Juris mentioned, the PHPRC variable was pointing to the stand alone php5.dll. I changed the path and all is good.
For future googlers: uncommenting the opcache enable and opcache_cli seemed to fix the problem for me.
That being said, I don't know what the error means

Categories