i was updating my production server with php 8 and i discovered an error "Fatal Error: Class mysqli not found". So i asked to the support and they told me that "according to php official manual, mysqli is not supported anymore in php 8".
I tried to find any news on the internet about this, but i can't find anything.
Looking at the php changelog, they talk about bugfixes for mysqli library until PHP 8.0.2, then nothing.
Looking at the MySQLi official page on the php manual, there is only "PHP5, PHP7" as supported (while there is PHP 8 on PDO instead).
So, has somebody any news about this? What happened?
I got the same problem installing Wamp Server on a local machine with PHP 8.0.6, so i think they really removed MySQLi from the library, but in both local and production doing a phpinfo() i can clearly see "mysqli" extension installed.
Thank you in advance.
EDIT:
About the production server, basically, provider told me "use sp-php instead of php", and now mysqli works.
About the PHP.net, i think they forgot to add the support.
It's just a documentation problem. There's a pull request to add PHP/8 to the supported versions but it hasn't made its way to live yet.
mysqli is still supported with php ≥8.
In my Ubuntu (22.04) for example, it was not included in the distribution. You can install it at any time with:
sudo apt-get install php-mysqlnd
After rebooting php, everything works as expected.
Hope this helps
Related
I am running codes that were running on php5 that support mysql_connect and I have migrated to another server that has php7.0. I realized that php7.0 does no longer support mysql_connect but it supports mysqli_connect. I don't want to go back to edit the codes and I don't want to go back to php5. I know that it's possible to install a patch that will support mysql_connect but I don't know how to do it. I am using ubuntu server 16.04.
For these purposes, there is exactly this package: https://github.com/dshafik/php7-mysql-shim
to make it working without code modification, you can include it in auto_prepend_file php.ini directive
mysql_connect is no longer supported in modern PHP versions for a reason.
I really recommend you to use PDOs.
Here's a really great, detailed tutorial: https://phpdelusions.net/pdo
I've been running in circles for about three days now. I've just set up a local SQL database and I transferred some php code I'm trying to run on it. Problem is, this php code uses the sqlsrv library and runs on a slightly older version of microsoft server.
No matter what I do, I can't get sqlsrv to load. I have quadruple checked my php.ini file, I had this problem with PHP 7, read some resources online that said sqlsrv doesn't work with php7, so I switched to php 5.6. I've tried the microsoft driver for sqlsrv for this php distribution. I've downloaded the SQL server native client.
Through all this, I can't get phpinfo() to load up sqlsrv. I've read various sources saying that sqlsrv isn't available for this version of PHP either, but I want a straight answer before I go through the motions of installing a different php.
Any help is appreciated. I've been through a lot of stack overflow questions and still couldn't find a straight answer, I'm happy to provide more information if required. (Also, I'm a noob in this kind of development, so forgive me if any of this is unclear)
Thank you!
My solution:
I ended up using an "unofficial" sqlsrv extension found here: https://onedrive.live.com/?id=669EE24817961774%21123&cid=669EE24817961774
I think I have an odd combination of 32 bit php 5.6 and Windows Server 2012. Hopefully this helps someone!
i try to install PrivMX WebMail but seems like one error still problem here,
php-dba PROBLEM
i try to find php_dba.dll on php.ini but it seems there is nothing there
im trying to find it on google but still fail
currently im using PHP version: 5.6.12 witn wampwebserver on windowns server
Any help?
There is no php_dba.dll distributed officially until PHP 7.2. Even if you compile it yourself for lower, you might need to get drivers you need manually. Particularly for Oracle. Otherwise you should be fine just upgrading to 7.2 as it also suports LMDB.
Thanks.
I am currently running an Apache 2.4 server with PHP 5.5.1, and it is connected to Django via mod_wsgi (in case that matters). This is all running on Oracle Linux. In this set-up, I am trying to use mysqli and the method mysqli_connect. However, I am facing issues with my mysqli set-up. I have used the following website: MySQLi Setup. However, even after running ./configure --with-mysqli=/usr/bin/mysqlconfig and ./configure --with-mysqli, I still do not see a mysqli section in my phpinfo() test site. I have run make and make install after both and it has worked fine.
Furthermore, when I try the following command ./configure --with-mysql=/usr/bin/mysql_config --with-mysqli=mysqlnd, I get the following error: configure: error: Cannot find MySQL header files under /usr/bin/mysql_config. Note that the MySQL client library is not bundled anymore!
On top of this, I have uncommented the extension=php_mysqli.dll line.
Right now, I have an idea of what I need to do, which is to get ahold of the MySQL client library and allow access to it by php. However, I am unsure of how to do this, and many of the questions + answers I have found have not worked.
Any help is appreciated. Thanks.
I have shifted my CakePHP (2.3.1 stable version) site to Host-ed.me and I am getting PDO class not found error. How to enble PDO on Host-ed.me server. Any suggestion is highly appreciated.
I suggest to first compare your previous/local PHP configuration with the configuration on hosted.me.
You can do so by generating a phpinfo() report of both. be sure to remove the phpinfo page afterwards - having a publicly visible phpinfo page on your website is a major security risk.
Check if PDO is really not installed on the webserver, either via the phpinfo() report or via instructions found in this question; How to determine if PDO is enabled in PHP?
You may also check if hosted.me is not using an outdated version of php, otherwise you may run into other problems later on
If PDO is not installed and is required for your website (or the php version is too old), there's no other option than to contact the hosting provider and ask them if it is possible to have it installed or your website be hosted on a different server.
Finally, if these options do not give you a solution, find a better hosting provider that does have a decent PHP installation :)
Check out this blog for details.
Basically, you have to do the folllowing:
1. Check if PDO is installed (lookinto your phpinfo() output / write simple program)
2. Install PDO, using yum install php-pdo
Test again, using the above scripts and you should be good to go.
You just need to enable the PHP extensions:
pdo
pdo_sqlite
sqlite
or ask host to enable them