How do I activate mysqli with wampserver? - php

I've spent over 6 hours trying to connect to phpMyAdmin, and would be pulling out my hair if I had any.
I downloaded wampserver, and have been dealing with issues. After solving about three of them, I finally got phpMyAdmin to pull up, but now it is giving me this error:
The mysqli extension is missing. Please check your PHP configuration. <img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help" />
I read a lot of the other solutions to this problem and have tried them. Namely the common answer seems to be to uncomment mysqli and a couple other extensions, which I have done.
After hours of trying different solutions, I am pretty stuck and could definitely use some specific answers if any are available.
I was looking at someone else's code, and I noticed that their config file was different then mine when they got it working.
Mine is linked to Windows, while theirs to their php.ini.
Is this potentially the problem, and if so how do I change it?
Here is mine:
Here is theirs:
Also, I can run phpMyAdmin through my hosting, but I need to run php on my localhost. Is phpMyAdmin even needed to do this? I loaded a file and it came up blank, without even posting the code or anything, so this is why I assumed I needed to mess with phpMyAdmin first.

There is a chance that there two installations of php. If not,then check that php.ini file is loading mysqli extension.
click on the icon in the system tray, go to PHP -> PHP Extensions and make sure it is checked
else go to php.ini file any uncomment this line
extension=php_mysqli.dll

If you get such an error without changing any settings of wampserver, just downgrade the php version, then select the version you are using again and it will be fixed.
System tray - Wampserver PHP -> PHP version - 7.4.26 change 7.3.33
Restart all service
Again
System tray - Wampserver PHP -> PHP version - 7.3.33 change 7.4.26
fixed

Related

Php version differs between homebrew and localhost

I try to update my php to 8.0 using homebrew. The update worked fine. The “php -v” shows that the actual version is 8.0.14. However when I open my localhost and go to “phpinfo.php” it shows the old version 7.4.22. Obviously my server still uses the old one. How to fix this? How to update the server version. I saw several post about similar problem, but the solutions offered didn’t work for me… I’m using Mac.
Thanks
So after long searching I finally found this step-by-step tutorial.
https://getgrav.org/blog/macos-monterey-apache-multiple-php-versions
What I did:
I added apache to my server;
I added php to my server (now I no longer need XAMPP);
I followed the step by step configuration to connect apache to php (through updates in httpd.conf file).

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 PHP MongoDB class with XAMPP on Windows 7

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.

Can't activate MySQL database on XAMPP

This seems to be a common problem and I've tried searching for an answer and attempted to fix my problem based on people's answers, but with no success.
The other day, I started my local XAMPP server and MySQL database and tried to access phpMyAdmin, but I got the error "Cannot load mysql extension. Please check your PHP configuration". The MySQL extensions in the php.ini file are all uncommented. I am really lost as to what has happened as it was working properly the day before. If I need to provide any more info, please let me know. Any advice would be greatly appreciated.
XAMPP installs Apache, PHP and Mysql which works out of the box. You must have some other PHP.ini which is interfering with XAMPP. See phpinfo() to find out which PHP.ini is being used.
Check in Program Files if PHP is installed separately. Remove this one.

PHP -> CLI has stopped working

I recently installed Windows 7 on my desktop and the following problem has begun occuring:
I regularly run some PHP scripts from the commandline that are now giving this error in a popup window:
CLI has stopped working.
I cancel this and my script terminates. Not good...
I've googled around and tried most of the few ideas suggested but still i am plagued by this annoyance. Right now it appears to regularly occur when I do a file_get_contents() of a url pointing to an image file. Only happens when the url is http protocol, works fine for ftp files. It also happens spuriously doing other things as well.
This is PHP 5.3.0 as distributed in a xampp 1.7.2 .zip. All exe's and dll's have been unblocked by copying thru FAT32 and back.
hints from anyone who's cracked this would be most helpful.
Try updating your PHP version bundled with xampp. You might have to update some php_XXX.dll extension files.
More info: http://web2.0entrepreneur.com/31/cli-has-stopped-working-on-windows-vista.html
PHP-CLI stops under these circumstances: Windows 7 64bit, PHP 5.6.8 64bit, only when Zend OpCache extension is ENABLED!!!
Just edit php.ini and comment zend_extension=php_opcache.dll (with ; in front of it)
I found that this happened to me when I had the APC extension enabled. I switched to using the Wincache for PHP extension instead.
If you receive this error after installing WAMP, most likely you have another installation of PHP on your machine. This may have been installed using the Microsoft Web Platform Installer or by other means. The first thing you should do is un-install PHP.
If this doesn't work, check to make sure that IIS and Apache are not trying to use the same port. WAMP starts out with Port 80 as standard and IIS usually will be the same. The easiest way to fix this is to turn off IIS while running WAMP, but you can set either of them servers to port 81 or another port.
If this doesn't work, my last suggest is to look for multiple copies of php.ini on your machine. You may find them in places like the Windows directory. Make a backup of the file just in case, and then remove them from all of the folders except the WAMP folder.
it happened to me in laravel 5.I searched every where but no solution that fix my problem then i debug my web application at different points and found that if you comment your php code in laravel comments in blade template like
{{--print_r($date_a);--}}
Now comment like this
//print_r($date_a);
works
The solution for me was to stop using PHP 5.3.0 and go back to 5.2.11. Once I did this the "CLI has stopped working" issue disappeared.
I have the same issue with Windows 7 Professional.
My Apache Server has no problem finding and executing PHP within my web application but the command line execution gives the infamous message "CLI has stopped working."
The User Account Settings seem to allow executions.
Perl has no problem.
I always have to take my code to an XP machine and run it there to debug it.
You didn't specify that you were using xdebug, but just in case you were, I may be able to help. I had this error for a long time. It turned out I was on a slightly older version of Xdebug (php_xdebug-2.2.0-5.4-vc9.dll).
I replaced that file with "php_xdebug-2.2.2-5.4-vc9.dll" and it magically started working immediately.
I'm on wamp, and I updated both php.ini files (one is for cli, one for normal use) with the latest filename.
"zend_extension = c:\wamp\bin\php\php5.4.3\ext\php_xdebug-2.2.2-5.4-vc9.dll"
Then dropped the new file into the php ext folder and instant success.
I had the same issue on Windows 7 (Home premium). I had a hunch that it is caused by one of the extensions I installed so I started commenting them out one-by-one.
Turned out it was caused by a non-compatible mongodb extension I was using
Edit php.ini and comment zend_extension=opcache.enable_cli=1 (with ; in front of it)
Try to use another php version instead.
It works perfectly for me.
Try to run scripts with php-cgi.exe instead of php.exe. For me it works.

Categories