Preview not loading on Home page and Theme Options

Hi

The preview doesn’t load on Theme Options or on Home page Cornerstone editor. I see that a lot of people are experiencing this problem, and I have tried everything suggested in the forum.

I have now installed a new website, and it keeps happening:

  • Brand new install – no customisations, no content
  • No plugins except Cornerstone
  • No caching
  • Latest versions of Wordpress, X and Cornerstone
  • No ModSecurity on my cPanel
  • PHP Memory has been increased in wp-config and I added set_time_limit(300);
  • PHP Version 7.2
  • Preview not loading on Theme Options and Home page, but loading on all of the other pages.

Please can you help to resolve this?

Hi There @designbythink ,

Thanks for writing in! I have tried disabling your plugins, then re-installing X theme and Cornerstone and also I have re-installed WordPress core as well. Then I have regenerated your .htaccess file but I see the same issue on your site.

I have seen a another user experience the same issue on PHP v7.2.x. Can you try switching your PHP version running on your server to a different version in between v5.6.x and v7.3.x and see how it goes. Also try enabling your WordPress debug mode by following this guide (https://codex.wordpress.org/WP_DEBUG) and see if you’re getting any PHP error messages.

You can also try contacting your hosting provider to make sure that you have setup your server correctly and also ask them to check your error logs. For further investigation, we will require your FTP credentials as well.

Let us know how it goes.
Thanks!

Hi, many thanks for your suggestions.

I tried all the different versions of PHP, and finally PHP v7 seemed to work. This worked for a hour, but then stopped working again! So now the preview still doesn’t load for Theme Options.

I have also tried PHP v7 on some of my other websites that have the same problem, but it didn’t work there at all.

My debug mode is set to true, but I do not know where to check for PHP error messages.

What else can I try?

Hi @designbythink,

In that case, would you mind providing your FTP login credentials as well? It seems an internal server error is happening through jQuery and I can’t pinpoint it directly either. Maybe I could find through FTP.

Thanks!

Hi

Thanks for looking into this. Before I get in touch with the hosts I want to know exactly what to say to them – otherwise they will refuse to help me and insist it is a theme or Wordpress issue, and not a server issue.

I’ll supply FTP login credentials in the secure note below.

Hi,

You forgot to include your FTP password.

Please provide it as well so we can check.

Thanks

I knew I was forgetting something! I have now updated the secure note.

Hi,

It was your footer content that was causing the issue. When I tried removing it, theme options loads without issues.
Though I tried copying it over to my test site and I didn’t have issues.

I checked your php version and it’s 7.0

Can you try updating it to 7.3 as required by wordpress

Hope this helps

Hi

Thanks for your response.

This doesn’t clarify why I experienced this problem with a brand new clean install of X with NO customisations and the original X footer content.

The Home page Cornerstone preview also still doesn’t work. ALL other pages work, just not the Home page.

With regards to the PHP version, please see the rest of the thread above. There is a good reason why I was using v7.0.

HI,

I checked again and found the error.

Please contact your hosting provider as this is most likely related to a server settings.

Thanks

Hi

Please could you clarify what exactly this error is? No hosting company is going to bother themselves with a Wordpress theme issue unless I can explain to them exactly what the problem is.

If I don’t tell them exactly what’s wrong, they will simply tell me to ask the theme developers, and that brings us right back where we started.

Many thanks for all your help!

Hello @designbythink,

The error is:
PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/design45/brevityocr.designbythinkdev.co.za/wp-includes/wp-db.php:1643

where wp-db.php is a WordPress core file. This has something to do with your server configuration. It could be the PHP version or MySQL version on your server. Just make sure that your server meets the necessary requirements to run the latest WordPress core. The latest WordPress 5.1 requires at least PHP version 7.2:

Hope this helps.

Hi

Many thanks for your efforts.

I have contacted my hosts, and they said that they only have PHP v7.2 on their shared Linux hosting servers.

I have taken a look at some of my other client websites with other hosts – also built using X and Cornerstone, but hosted on a server that is only PHP v5.6. They work perfectly.

So the problem is probably not the PHP version…in fact, the older the PHP version, the more likely the previews are to work.

What else can I try?

I did some testing on all the different PHP versions:

PHP v7.3 – not supported

PHP v7.2 – Theme Options preview NOT loading
Home page Cornerstone preview NOT loading
Other pages Cornerstone preview works

PHP v7.1 – Theme Options preview NOT loading
Home page Cornerstone preview NOT loading
Other pages Cornerstone preview works

PHP v7.0 – Theme Options preview works
Home page Cornerstone preview works
Other pages Cornerstone preview works

PHP v5.6 – Theme Options preview works
Home page Cornerstone preview works
Other pages Cornerstone preview works

This is the server configuration info my hosts gave me:

​Server: Localhost via UNIX socket
Server type: MariaDB
Server connection: SSL is not being used Documentation
Server version: 10.0.37-MariaDB-cll-lve - MariaDB Server
Protocol version: 10
Server charset: UTF-8 Unicode (utf8)

Does any of this offer a clue as to what is going wrong?

Hey @designbythink,

I checked your site and everything seems setup properly so this most probably boils to configuration in your web host. We’d like to know more details that might help us lead to the cause.

  1. Are the sites that are not working hosted in the same host?
  2. Are those sites using PHP 7?
  3. Does PHP 5.6 work for all those sites? If all sites work with PHP 5.6, it’s highly likely that there’s a setting in PHP 7 that caused the issue. Our products are compatible with PHP 5.6 and up. But, there are PHP features, especially PHP 7, that can cause issue. Regretfully, since our products do not have a problem with popular / standard web hosts, we have no list of what those PHP features are.

I’m using PHP 7.2 in one of my sites in a shared host and I don’t get this issue. Here are my PHP 7.2 settings. Maybe you could try replicating that and see if it works.

Please also contact your host if they have a security software (not limited to ModSecurity) that could block iframes loading in the root domain.

Thanks.

Hi

1. Are the sites that are not working hosted in the same host? – Yes. But I have contacted the host and they sent me the following reply, so they intend to be of no help:

The error clearly states that the website code is looking for a PHP function that does not exist or is not included in the wp-db.php file. This is not server related.

2. Are those sites using PHP 7? – As per the Theme.co support staff’s suggestion I have increased the PHP v7.2, even though I have better results on PHP v7.0 and PHP v5.6 below (as can be seen in my post above).

3. Does PHP 5.6 work for all those sites? – Not for all sites. It works for some sites, but in other cases the Home page Cornerstone preview still doesn’t load. The freaky part is that it used to work exactly as is, and then stopped working without me making any changes to the server or the hosting. Which leads me to believe that it is at least partially theme-related.

I have tried your settings for PHP v7.2 and they have made no difference:

  • Theme Options preview NOT loading
  • Home page Cornerstone preview NOT loading
  • Other pages Cornerstone preview works

UPDATE:

I have made another discovery. Some of my websites – all hosted on the same server – do not load the Theme Options preview at all, no matter what version of PHP I use. This is extra annoying, because when I set them up yesterday, they DID load.

I set up the site at http://unison.designbythinkdev.co.za yesterday without customising anything. The Theme Options preview doesn’t load on ANY version of PHP.

The tester site I have been using http://test.designbythinkdev.co.za/ DOES load the Theme Options preview on PHP v5.6 and PHP v7.0.

There is virtually NO difference between these sites. Why do they react differently?

Thanks for providing more details.

I see that both sites are virtually identical except for the fact that X and Cornerstone is up to date in the site that is not working. I’ve updated the other site that is working and now it’s not working.

I remember the previous site I checked was not yet updated yet the issue happened though so this is really weird. Honestly, this only means that the web host is unstable. The web host usage limit or an unknown configuration is the only thing that varies in the setup. Our products and WordPress in general only executes code. If the server could not handle the execution of all the sites in their server, there would be problems like this.

By limitation, I’m not referring to memory only but also CPU usage. That’s especially the case if you have many sites in a shared host where usage of other users or even your other sites can affect the rest of your other sites. If you’re in a VPS, it’s most probably some server configuration especially security configuration.

Regretfully, we’re out of options in this case. We also could not dig deeper into this because we do not have direct access to the server. By direct access, I mean server controls and not only FTP or cPanel.

Personally, I’ve never experienced this issue yet in any of my test sites. To quickly check my claim that the web host is unstable, please try setting up a fresh WordPress, X and Cornerstone install in another web host. I personally have tried cheap hosts like FastComet and NameCheap hosting. Just note that it’s not a recommendation but just to give you an idea. If you could test quality managed hosts, that would be even better.

I also forgot to tell that please disregard this error PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/design45/brevityocr.designbythinkdev.co.za/wp-includes/wp-db.php:1643. It’s a past error and if that still applies, your site should have been down as it’s a Fatal error and it relates to database connection. It’s not related to the issue at hand.

Thanks.

Hi

Many thanks for your help with this. I have emailed the hosts again, and hope to get a more helpful response this time.

I have also created a tester site on one of my other domains hosted with another company, and experienced no issues whatsoever. So it would appear that it is definitely a server/hosting issue.

If I manage to find a solution I will post it here, just in case it is helpful for someone else experiencing the same thing.

You’re most welcome @designbythink :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.