PHP 7.1 Problems

4 posts by 2 authors in: Forums > CMS Builder
Last Post: September 6, 2019   (RSS)

By rez - August 22, 2019 - edited: August 22, 2019

Hi. My customer keeps contacting me every few days that their site is down. This is the error seen when you go to the domain:

"This program requires PHP v7.1.0 or greater. You have PHP v5.6.40 installed. Please ask your server administrator to upgrade PHP to a newer version"

I am using CMSB v3.51 (Build 2244)

To temp fix this, I have been going into cpanel and switching the PHP version around and back 7.1 or calling my host and having them look at this and we get the site back up. This time, I noticed in the htaccess file this is at the top:

<IfModule mod_suphp.c>
    suPHP_ConfigPath /opt/php71/lib

However, at the the bottom of the htaccess file it was forcing PHP 5.6 with similar code.\

The full htaccess file is below. You can see it now has 7.1 at the bottom as well as the top. When the site is down,  I go into cpanel, (my host tech helped me figure this out) and I used the PHP selector to select 7.1 but also went into the public_html folder and had to do the same thing. The site comes back up with the fixed htaccess.

However, in a few days my customer will call me and tell me their site is down again and I will have to repeat this. So it seems that they are doing something in the cms that rewrites htaccess and makes the bottom force 5.6 again.

This must have happened when I updated CMSB to v3.51 (Build 2244) and PHP to 7.1 using the cpanel selector. 

Please advise. Do you know what keeps  rewriting htaccess and the force of 5.6?

I don't know if this error found in CMSB developer log is related:

E_NOTICE: Array to string conversion
line 1043

#0 _errorlog_logErrorRecord() called at [/home2/domain/public_html/cmsAdmin/lib/errorlog_functions.php:64]
#1 _errorlog_catchRuntimeErrors() called
#2 implode() called at [/home2/domain/public_html/cmsAdmin/lib/viewer_functions.php:1043]
#3 _createDefaultWhereWithFormInput() called at [/home2/domain/public_html/cmsAdmin/lib/viewer_functions.php:399]
#4 _getRecords_getQuery() called at [/home2/domain/public_html/cmsAdmin/lib/viewer_functions.php:98]
#5 getRecords() called at [/home2/domain/public_html/index.php:33]

By daniel - August 23, 2019

Hi rez,

I can't think of anything in CMSB that would be rewriting the .htaccess file like that - especially forcing it back to PHP 5.6. My initial thought is that there could be some configuration on the server that is checking for the directive on a regular basis, and adding it if it doesn't exist (the directive itself is for suPHP, which is server-specific). I realize you've talked to your host about this already, but it looks like they're going to be your best bet for getting this issue sorted, or at least diagnosing what is happening. A few specific things you can ask them about are:

  • Is there any higher-level server configuration for PHP versions that could be overriding the cPanel config?
  • Can they do a text search through your web directory to see if there is any custom code adding the directive?

I hope this helps point in the right direction, let me know if there's anything else I can help with!


Technical Lead

By rez - August 24, 2019 - edited: August 24, 2019

Ah, ok. Well I don't think that it was actually changing the cpanel / PHP version selector. Something has been writing into the file and forcing 5.6. Same thing, I guess. When I went into the cpanel 7.1 was actually still selected. I think the htaccess must take priority? I think when i would go into cpanel and switch from 7.1 to 5.6, then back to 7.1 that was actually a way of me rewriting the htaccess to force 7.1. I didn't understand how what i was doing was working to bring the site back up at the time. When my host told me something was writing that entry into the file to force 5.6, I figured this all out... I think... ;)

I assumed it was CMSB and they agreed. I hear you though. I'll take all of this info back to the host and maybe they can tell me what keeps writing 5.6 into the htaccess file. 

Thank you.