markoheijnen / wp-db-driver

45 stars 12 forks source link

PHP7 and PDO => crash #105

Open petervanderdoes opened 8 years ago

petervanderdoes commented 8 years ago

The error message I get: PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error in /var/www/xxxx/htdocs/content/plugins/wp-db-driver/drivers/pdo_mysql.php:277

WordPress: 4.4.2 WP-DB-Driver: 2.1.0 PDO Driver for MySQL enabled Client API version mysqlnd 5.0.12-dev - 20150407

markoheijnen commented 8 years ago

It was also reported here: https://wordpress.org/support/topic/php703-and-percona-57?replies=3. I don't have much to look into it so will see when I can fix it.

petervanderdoes commented 8 years ago

I just send a PR #106 which should fix this problem. I can't explain exactly why it solves the problem though.

markoheijnen commented 8 years ago

If that PR is how it should be solved then it is indeed weird. I also enabled PHP7 in the Travis unit tests but weirdly enough they are passing. Though the PDO unit tests do show some possible weirdness

petervanderdoes commented 8 years ago

Well I just installed PHP 7.0.4 and without the above PR everything works fine. I do also agree it's weird that there are no errors concerning this issue in travis. I also don't understand why there are some many other SQL errors in travis, but that's beside the scope of this issue.

simonhampel commented 8 years ago

I'm seeing these uncaught PDOException errors in my log files whenever wp-cron executes.

2016/06/12 01:11:42 [error] 3128#3128: *642 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000]: General error in /srv/www/example.com/wp-content/plugins/wp-db-driver/drivers/pdo_mysql.php:277
Stack trace:
#0 /srv/www/example.com/wp-content/plugins/wp-db-driver/drivers/pdo_mysql.php(277): PDOStatement->fetchObject()
#1 /srv/www/example.com/wp-content/plugins/wp-db-driver/inc/db-driver.php(1687): wpdb_driver_pdo_mysql->get_results()
#2 /srv/www/example.com/wp-content/plugins/wp-db-driver/inc/db-driver.php(1891): wpdb_drivers->query('UPDATE 'wp_opti...')
#3 /srv/www/example.com/wp-includes/option.php(328): wpdb_drivers->update('wp_options', Array, Array)
#4 /srv/www/example.com/wp-includes/cron.php(464): update_option('cron', Array)
#5 /srv/www/example.com/wp-includes/cron.php(101): _set_cron_array(Array)
#6 /srv/www/example.com/wp-includes/cron.php(147): wp_schedule_event(1465693991, 'nxsreposter', 'nxs_querypost_e...', Array)
#7 /srv/www/example.com/wp-cron.php(103): wp_reschedule_event(14656939" while reading response header from upstream, client: 2400:8900:xxx:xxx::100, server: www.example.com, request: "POST /wp-cron.php?doing_wp_cron=1465693902.3811419010162353515625 HTTP/1.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.example.com"

I've just moved my site to a new server running PHP 7.0.7 WP DB Driver v2.1.0 Driver in use: "PDO - MySQL"

Also reported here: https://wordpress.org/support/topic/uncaught-pdoexception-php-707

davidbell commented 8 years ago

4 months, 3 weeks later, I was experiencing the same problem yesterday, except once I'd been logged out overnight I couldn't get into wp-admin at all. Is it so rare to be running PHP7 and want to use PDO that no-one else is reporting this problem?

PHP 7.0.8 mysql Ver 14.14 Distrib 5.7.16 WordPress 4.6.1 WP DB Driver Version 2.1.0

markoheijnen commented 8 years ago

Will look into it soon. At least before WordPress 4.7 has been released.