Search code examples
phpmysqliphp-5.5php-5.6

PHP 5.5 > PHP 5.6 Upgrade Causing MySQL Issues?


Apologies if this has been asked before. I have been searching high and low and have come up with little in terms of results, but I might not be wording my search properly.

I attempted to upgrade from PHP 5.5 to PHP 5.6 today and it broke all my sites that make use of MySQL (all other PHP-only code was fine).

I am not getting MySQL Errors, I do see the connection being established, but it appears the queries aren't hitting the MySQL server. Instead, it seems the queries are being printed on the screen, and they aren't actually being executed.

I have 2 examples

1:

here

2:

here

Example 1 should show a login form, and Example 2 should show a drop down box with users to select. The login form and drop down box have been drawn on screen, but they are either not populated correctly or populated with variable names instead of results.

I read through the migration guide at PHP, even the notes about latin1 charset (mine are UTF8), but there isn't much there.

Is there something obvious I am missing or something I did not yet read? Or should I be digging deeper? The Apache & PHP logs didn't appear to show much. I'm running out of options as my google searches are coming up blank. Has anyone else experienced this before?

Switching to PHP 5.5 brought all the sites back to normal without the errors / issues above. Switching back to PHP 5.6 introduces the errors / issues above again, so I believe it is something specific to PHP 5.6, but I'm baffled at the fact it does the mysqli_connect without error.


Solution

  • It looks like your problem extends beyond SQL queries. Your first image shows PHP code being outputted. Are you sure your configuration hasn't changed, for example turning short_open_tag off?