MySQLi is enabled but not loaded in Windows Server 2008 - php

I've installed PHP5.6, PHP7.0, PHP7.2 in my server with extension=php_mysqli.dll enabled.
The project is written for PHP7.0, able to connect db with PHP5.6, but not in 7.0/7.2
May I know how can i do further testing to find out the problems? No sign of MySQLi in phpinfo().

Related

Sqlsrv dll does not properly load on IIS

I am using PHP 7.3 and trying to run sqlsrv but I cannot get my PHP environment to load sqlsrv. I look at the phpinfo and the extension does not show up. These are the steps I have taken.
Through the Web Platform Installer, I have installed PHP 7.3 for IIS, the SQL Server Driver, and the Windows Cache Extension.
I have put php_sqlsrv_73_nts_x64.dll in the extension directory.
I have verified my php.ini configurations.
Downloaded and installed the latest Microsoft ODBC driver.
Found the bug. Turns out I was had installed the SQL Server Driver for IIS when I really needed the SQL Server Driver for IIS Express.

configure pdo_dblib - freetds already installed

I am running a Linux server that already has freetds installed, but is not configured to support dblib. Only sqlite and mysql are currently supported for PDO. MSSQL support is also enabled.
If I want to add support for dblib and enable the PDO Driver for FreeTDS/Sybase DB-lib, do I just need to run this command on the existing install:
./configure --with-pdo-dblib
If so, from which directory would I run the command?
Environment:
PHP Version 5.5.38
CENTOS 6.9
Thank you
If you have configured FreeTDS correctly, you should be able to connect like so:
$pdo = new PDO("dblib:host=mssql;dbname=$dbname", "$dbuser","$dbpwd");
If you can't, this answer gives more explicit instructions: Connect PHP to MSSQL via PDO ODBC
pdo_dblib is typically installed in most Linux distros when you install php-mssql (on CentOS and Ubuntu, for example). If the connect command isn't working, please rewrite your question to include the specific steps you have taken and the error output. Good luck!
Since writing this question, the support team at the company that is hosting this server installed the driver. I don't know exactly what steps they took to do it so I can not post a step by step answer as I would like. Closing this question.

Installing Roundcube with MSSQL Server 2016 not recognized

PHP 7.1.2
Roundcube 1.2.3 - Complete
SQL Server 2016
Windows Server 2016
Downloaded Microsoft PHP drivers (SQLSRV40.EXE) from:
https://learn.microsoft.com/en-us/sql/connect/php/step-1-configure-development-environment-for-php-development
I get the following error message when trying to run the Roundcube installer and unable to continue:
Sorry but your webserver does not meet the requirements for Roundcube!
Please install the missing modules or fix the php.ini settings according to the > above check results.
Hint: only checks showing NOT OK need to be fixed.
Nothing is marked as "NOT OK" on the entire page, however the database does not appear to be recognized. See the following copied from the installer page:
Checking available databases
Check which of the supported extensions are installed. At least one of them is required.
MySQL: NOT AVAILABLE(See http://www.php.net/manual/en/ref.pdo-mysql.php)
PostgreSQL: NOT AVAILABLE(See http://www.php.net/manual/en/ref.pdo-pgsql.php)
SQLite: NOT AVAILABLE(See http://www.php.net/manual/en/ref.pdo-sqlite.php)
SQLite (v2): NOT AVAILABLE(See http://www.php.net/manual/en/ref.pdo-sqlite.php)
SQL Server (SQLSRV): NOT AVAILABLE(See http://www.php.net/manual/en/ref.pdo-sqlsrv.php)
SQL Server (DBLIB): NOT AVAILABLE(See http://www.php.net/manual/en/ref.pdo-dblib.php)
Oracle: NOT AVAILABLE(See http://www.php.net/manual/en/book.oci8.php)
I have verified the Microsoft drivers are in the PHP extension directory and attempted to include the following extensions (one at a time) in PHP.ini:
extension=php_sqlsrv_7_nts_x64.dll
extension=php_pdo_sqlsrv_7_nts_x64.dll
I have also tried other various SQL related extensions and restarted IIS and/or Windows with no success.
It appears that the SQLSRV dll files must match the version of your PHP. I installed PHP 7.1 and attempted to use Microsoft's 7.0 driver.
After locating the proper driver from GitHub.com/Microsoft/... it placed the "OK" next to the MS SQLSRV and enabled the "Next" button to continue the RoundCube WebMail install.
For ubuntu 16 operating system try to run
php -m
if mysqli is not shown after running this command then install mysqli
For PHP 7.0 version
sudo apt-get install php7.0-mysqli
For PHP 5 version
sudo apt-get install php5-mysqli

Can't find MySQL driver anymore (Linux)

Today some of my packages in Ubuntu was upgraded automatically, and I didn't think of what was actually going on.
Ever since the update, my local dev-environment doesn't work anymore. First of by not working was mod_rewrite which I had to enable again using a2enmod. But now I've run into an issue that I can't seem to resolve. My application can't seem to find the PDO MySQL driver. When running the application, I get the error failed to open the DB connection: could not find driver.
This is strange, since if I check the phpinfo() the PDO drivers do support MySQL, and the socket path is a valid path.
pdo_mysql client API version is 5.5.35 according to php info.
PHP5: 5.5.3
MySQL: 5.5.35
Connectionstring
mysql:host=127.0.0.1;dbname=MyDB;port=3306
What could be causing this?
The PHP MySQL driver (mysql.so/mysqli.so) and the PHP PDO MySQL driver (pdo_mysql.so) are two separate modules. You need both of them for PDO functionality with MySQL.
It is quite possible that one of them is missing or of an incompatible version - I do not have an Ubuntu system at hand, but on my RPM-based Linux distribution there is a separate package for each module (php-mysql/php-mysqli and php-pdo_mysql). I also expect PDO to be using the newer mysqli.so driver, rather than the obsolete mysql.so one, so you should verify that one is installed as well.
Try this:
sudo apt-get install -y php5-mysql php5 mysql-client
This should automatically restart your apache if any of the dependencies aren't installed.
Try using vagrant.
Dependencies can be isolated, upgraded and downgraded when you like.
Vagrant

install Microsoft Drivers for PHP for SQL Server on Windows 8

Does Windows 8 supports sql server driver for php.
I found that system Requirements for sql Driver does not contain Windows 8.
I installed and configured sql driver for php on wamp server, but sqlsrv doesn't show in phpinfo().
It's working fine for me on windows 8, if you don't activate the good extension in php.ini, by default (int XAMP) the slqsrv extension is selected extension=php_pdo_sqlsrv.dll, in my case, I am using PHP 5.4 and have configured the following extension:
extension=php_pdo_sqlsrv_54_ts.dll
See Readme file provided with the installation drivers to see which extension to activate in your case.
Restart the server and it's done.

Categories