Title: Database Error
Last modified: July 5, 2021

---

# Database Error

 *  Resolved [wpu9000](https://wordpress.org/support/users/wpu9000/)
 * (@wpu9000)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/database-error-342/)
 * Hello, my website crashed with the error “Error establishing a database connection”.
   I contacted Cloudways and they said the problem was with the plugin Force Refresh
   and they provided the error logs below.
 * [Sun Jul 04 22:04:46.301796 2021] [proxy_fcgi:error] [pid 17904:tid 139917367514880][
   client 5.11.73.36:28158] AH01071: Got error ‘PHP message: PHP Warning: Constants
   may only evaluate to scalar values in /home/99705-76536.cloudwaysapps.com/xjbyqrugcr/
   public_html/wp-content/plugins/force-refresh/filter-force-refresh.php on line
   30\n’, referer: [http://www.whiterockgallery.com/michael-otoole-archive/](http://www.whiterockgallery.com/michael-otoole-archive/)
 * [Sun Jul 04 22:04:48.466418 2021] [proxy_fcgi:error] [pid 17904:tid 139917291980544][
   client 97.113.154.214:28162] AH01071: Got error ‘PHP message: PHP Warning: Constants
   may only evaluate to scalar values in /home/99705-76536.cloudwaysapps.com/xjbyqrugcr/
   public_html/wp-content/plugins/force-refresh/filter-force-refresh.php on line
   30\n’, referer: [http://www.whiterockgallery.com/new-arrivals/](http://www.whiterockgallery.com/new-arrivals/)
 * I was wondering if you could confirm that the plugin was the cause of the database
   connection problem. I am not sure how to resolve this issue as I can’t update
   to the latest version of your plugin because my WordPress site does not meet 
   the new requirements listed for the latest version of Force Refresh.
 * (by the way your plugin is great, it has made a huge difference to the site, 
   before I was using Force Refresh clients were always complaining that they did
   not see updates and after using it they see the daily updates.)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdatabase-error-342%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [jordanleven](https://wordpress.org/support/users/jordanleven/)
 * (@jordanleven)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/database-error-342/#post-14628588)
 * Hey [@wpu9000](https://wordpress.org/support/users/wpu9000/)! That error is not
   a MySQL error, that’s a PHP error. It sounds like you’re probably using PHP 5.6,
   which is unsupported. Can you see if [this forum](https://wordpress.org/support/topic/constants-may-only-evaluate-to-scalar-values/)
   solves your issue?
 *  Thread Starter [wpu9000](https://wordpress.org/support/users/wpu9000/)
 * (@wpu9000)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/database-error-342/#post-14628601)
 * Yes, I am using version 2.1 of your plugin, which I think was ok on PHP 5.6..
 *  Plugin Author [jordanleven](https://wordpress.org/support/users/jordanleven/)
 * (@jordanleven)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/database-error-342/#post-14628650)
 * Ah, that might be an incorrect attribution in the documentation. 2.1 is not compatible
   with PHP 5.6. I generally try to keep the plugin compatible with older version
   of PHP but with 5.6 reaching end of life in 2018, there were some features I 
   was losing out on by supporting it. Version 2.0, I believe, should work on 5.6
   though.
 *  Thread Starter [wpu9000](https://wordpress.org/support/users/wpu9000/)
 * (@wpu9000)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/database-error-342/#post-14628677)
 * This is from the plugins folder readme :
 *     ```
       === Force Refresh ===
       Contributors: jordanleven
       Tags: force, refresh, reload, single, page, application, ajax
       Requires at least: 4.0.0
       Tested up to: 5.2
       Stable tag: 2.1
       License: GPLv2 or later
       ```
   
 * The header in the code also lists 2.1
 * What I don’t understand is nothing has changed in the setup for the website in
   many months, so this error must have been there before?.. I wonder if it actually
   had anything to do with the database problem.
 * How do I downgrade to 2.0?
    thank you
 *  Plugin Author [jordanleven](https://wordpress.org/support/users/jordanleven/)
 * (@jordanleven)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/database-error-342/#post-14628758)
 * Hey [@wpu9000](https://wordpress.org/support/users/wpu9000/),
 * Yes, README is correct. It actually appears that support for PHP 5.6 is _not_
   in that README folder (“Requires at least” and “Tested up to” refer to the WordPress
   versions that are required by [every plugin](https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/#readme-header-information)).
 * For the question about if the error was there before, that’s something you’d 
   want to check with Cloudways about. What I can tell you authoritatively are two
   things:
 * 1. The error message you sent back is a PHP issue related to using an [array in a constant definition](https://github.com/jordanleven/force-refresh/commit/1069aada46036500c550683e81b7c5c186f3be41#diff-bb9396cd31119348935ec6cbe1107913d70ae61b7e131cc01eb51470264ea2b9R30)
   which were [not supported in PHP 5.6](https://www.php.net/manual/en/language.constants.syntax.php).
   Whether this is causing a fatal error that can be handled by the server is something
   I wouldn’t be able to tell but something that one of the backend people from 
   Cloudways would be able to tell you.
 * 2. If you haven’t been updating Force Refresh, there is, from a technical standpoint,
   no way I can see that this error would just spring up. It’s possible the server
   configuration on Cloudways changed recently and that’s why you’re just noticing
   it. But if you haven’t changed anything on your end, there’s no way for this 
   to spontaneously start happening _unless_ the plugin was updated from 2.0 to 
   2.1.
 * Lastly, to download a specific version of Force Refresh, it’s the same process
   as any other plugin. Navigate to the [Advanced section of the plugin](https://wordpress.org/plugins/force-refresh/advanced/),
   scroll down to “Previous Versions”, and replace the downloaded file on your server.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Database Error’ is closed to new replies.

 * ![](https://ps.w.org/force-refresh/assets/icon-256x256.png?rev=2428247)
 * [Force Refresh](https://wordpress.org/plugins/force-refresh/)
 * [Support Threads](https://wordpress.org/support/plugin/force-refresh/)
 * [Active Topics](https://wordpress.org/support/plugin/force-refresh/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/force-refresh/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/force-refresh/reviews/)

## Tags

 * [Database Error](https://wordpress.org/support/topic-tag/database-error/)

 * 5 replies
 * 2 participants
 * Last reply from: [jordanleven](https://wordpress.org/support/users/jordanleven/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/database-error-342/#post-14628758)
 * Status: resolved