'how to install mysqli on windows iis server?
I am trying to run mysqli on my remote windows server and I keep getting this error
Fatal error: Call to undefined function mysqli_connect()
I assume mysqli is not installed on my remote server. So how do I install mysqli on my remote server.
Solution 1:[1]
mysqli is a PHP extension. So all you have to do is enable that extension in your php.ini file.
Uncomment:
;extension=php_mysqli.dll
To:
extension=php_mysqli.dll
If using a share hosting account, you may have to create a .htaccess and point it to your own copy of php.ini.
To do that, you could try the following:
If php is installed as a module: In your
.htaccessputSetEnv PHPRC /location/todir/containing/phpinifileIf php is installed as a cgi extension, put your
php.iniin thecgi-binfolder.For some hosts, you can also just put your
php.iniin the folder where you would usually put your.htaccessfiles.
Solution 2:[2]
I am using Windows-10 / IIS server / PHP Version 7.3.10 Resolved using below changes.
inside the php.ini file non-working configuration
;extension=mysqli
extension_dir = ext
working configuration:
extension=C:\<my-work-folder-path>\php\ext\php_mysqli.dll
extension_dir = "C:\<my-work-folder-path>\php\ext"
After saving changes to file
IISRESET
Solution 3:[3]
On Windows:
- Copy and paste php.ini-production file, changing its name for php.ini (root directory of PHP)
- Change following lines
; extension=mysqli
; extension=/path/to/extension/mysqli.so
to anything like this:
extension="C:\Program Files\php\ext\php_mysqli.dll"
extension_dir="C:\Program Files\php\ext"
Special thanks to Baburaj's answer.
Solution 4:[4]
(Working on windows)
I was facing exactly the same issue.
In my case, the problem was that I had saved the php.ini file as a text file. As soon as I converted the text file to "All Files" in notepad and gave it the ".ini" extension, it became a "Configuration Settings File" and it worked.
You may check if this is the case by going through the loaded configuration file row in phpinfo(). If the value is 'none', you may be facing a similar issue.
Note: I had already uncommented the extensions and fixed the extension directory.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Baburaj |
| Solution 3 | |
| Solution 4 | nyi |
