1

Error:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0

I have this code,

$con=mysqli_connect("localhost","rss","(pass removed)","rss");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

// Perform queries 

mysqli_query($con,"INSERT INTO members(username, password) VALUES('test', 'test'");

mysqli_close($con);

And it isn't working. PHP is saying MySQLi is not installed, but on phpinfo() it's fine?

I've installed mysqli with apt-get install php7.0-mysql php7.0-mysqli, still isn't working.

It is connecting to the database.
Any help would be appreciated.

chris85
  • 23,846
  • 7
  • 34
  • 51
Phil
  • 124
  • 11
  • I think you have an extra closing brace at the end `}` – Maximus2012 Nov 17 '16 at 19:48
  • Do you have error reporting turned on for your PHP code ? Or check the error logs maybe ? – Maximus2012 Nov 17 '16 at 19:49
  • Sorry - I removed some code from the script, I'll edit that out. It isn't that. – Phil Nov 17 '16 at 19:51
  • You're getting a 500 still and your error log isn't populated? – chris85 Nov 17 '16 at 19:56
  • @chris85 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0 – Phil Nov 17 '16 at 20:06
  • That should be in the question. That is a configuration, not a script issue though. Are you running `phpinfo` on the same PHP version the script is running against? – chris85 Nov 17 '16 at 20:09

0 Answers0