PHP Fatal Error in Theme File (cont)

Re-opening a support ticket with the same title that just got closed (sorry, I don’t seem to get notification emails when you respond): PHP Fatal Error in Theme File

Just created a staging site for you to check. I’m still getting fatal errors in my log:

[Tue May 25 15:58:53.258943 2021] [proxy_fcgi:error] [pid 32321:tid 140480987784960] [client 192.88.134.10:50704] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function x_get_view() in /var/www/vhosts/
------------.com/httpdocs/wp-content/themes/pro/index.php:16\nStack trace:\n#0 {main}\n  thrown in /var/www/vhosts/------------.com/httpdocs/wp-content/themes/pro/index.php on line 16'

Hi @samuraicow,

It has been found that you are still using the PHP version 7.3.28, I would suggest you upgrade the PHP version to 7.4 by contacting your Hosting Service provide and try to update the theme once again.
If that does not work, please let us know for further investigation.

Thanks

Thanks for your suggestion. I updated to PHP 7.4.18, but the fatal errors are still appearing in my error logs.

Hello @samuraicow,

For your PHP Test subfolder, there is no longer an error. In your main site, there is. Please reinstall the Pro theme on the main site. You will have to do it manually.

Kindly let us know how it goes.

Hi Ruenel,

I manually updated the Pro theme. but the error still appears.

Hi @samuraicow,

I have checked your test site and found that everything is up to date including PHP and Pro, but didn’t find the issue you are still having. Can you please let us know where we can get this error to check for further investigation?

Thanks

It shows up in the Apache error logs:

[Mon May 31 03:26:12.740442 2021] [proxy_fcgi:error] [pid 7564:tid 140334870808320] [client 192.88.134.10:37004] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function x_get_view() in /var/www/vhosts/___________.com/httpdocs/wp-content/themes/pro/index.php:16\nStack trace:\n#0 {main}\n thrown in /var/www/vhosts/___________.com/httpdocs/wp-content/themes/pro/index.php on line 16'

Hi @samuraicow,

I have checked the Acpache error.log file and found the issue logged. I have also checked the debug.log which logged the WordPress errors, found multiple notices and warnings from the plugin named KC S2M+MC Pro but didn’t find any error like that, but not any error like you mentioned. I would request you deactivate the mentioned plugin and check if that resolved the issue. I would also suggest you remove the Pro and re-install it by downloading from the Themeco account once again and let us know if that resolved the issue.

Thanks

Hi @tristup,

De-activated KC S2M+MC Pro, removed and re-installed Pro as instructed, but the issue persists. Is it strange that the PHP fatal error appears in the Apache server log but not the WP debug log?

Hi @samuraicow,

The function x_get_view() is the main function to display the Pro template routing. Having this kind of error would mean that the file /wp-content/themes/pro/framework/functions/global/view-routing.php is missing or corrupted. But since you already reinstall the PRO and the issue still persists, it is possible that one of the customizations on the child theme is causing the error. Can you switch to parent PRO and see if the error persists.

Thanks,

I cannot switch to Pro as it would completely break the live site. Is there any way to know which page template is calling x_get_view() and causing the fatal error?

Hi @samuraicow,

Please do the same steps by copying your live site to a staging server so that it does not break your live site.
And also give us access in the secure note including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

Hi @tristup,

My staging info is already attached as a secure note in the first post of this thread. I’ve just updated it to match the current site (with the replaced Pro theme). Since no one is actively visiting the staging site, the fatal error isn’t appearing. I tried visiting a number of pages on the site to try and re-create the fatal error but have had no luck.

Hi @samuraicow,

That means there is something on the live site that is not on staging. Can you do a complete clone of the live site? We need to test the site in the parent theme to see if the issue happens on the parent theme. If it’s not, then it’s on the child theme. If so, unfortunately, there is no way to pinpoint which file/template is causing the issue, it could be multiple files or one of your custom functions.

I recommend doing an audit on these custom files/templates, and check the counterpart files/templates on the parent theme, if you see differences then you need to update the files on the child theme to adhere with the parent theme.

Thanks,

It’s a complete clone, but I do not see any fatal errors pointing to the staging site URL in the server logs. Of course, no one is visiting the staging site as often as the live site, so it could just be a numbers game.

Please try logging into the staging site again. Thank you!

Hi @samuraicow,

Unfortunately, the given credentials are not working. Can you please check and send it once again.

Thanks

From the login screen, it looks like you’re trying to access the live site and not the WP Staging site. Do you need access to the live site as well?

EDIT: Should be working now!

Hello @samuraicow,

Please check your Apache log now. Are you still having the fatal error? If you have completely cloned the live site into the staging site, every time we view the staging site (which I did browse several pages in it) should at least return an error in your log. It could displaying:

PHP Fatal error: Uncaught Error: Call to undefined function x_get_view() in
 /var/www/vhosts/___________.com/httpdocs/php-test/wp-content/themes/pro/index.php:16

If you are no longer seeing any error, the issue might have been resolved already.

Thanks.

Hi @ruenel,

Yes, the error seems to occur twice a day around 03:00 and 15:00 every day on the live site.

There are no references to the staging site in the error log, only the live site.

|2021-06-05 03:16:49|Error|192.88.134.10||AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function x_get_view() in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php:16\nStack trace:\n#0 {main}\n thrown in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php on line 16'||||Apache error|
|2021-06-05 15:22:39|Error|192.88.134.10||AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function x_get_view() in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php:16\nStack trace:\n#0 {main}\n thrown in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php on line 16'||||Apache error|
|2021-06-06 03:27:10|Error|192.88.134.10||AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function x_get_view() in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php:16\nStack trace:\n#0 {main}\n thrown in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php on line 16'||||Apache error|
|2021-06-06 15:31:32|Error|192.88.134.10||AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function x_get_view() in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php:16\nStack trace:\n#0 {main}\n thrown in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php on line 16'||||Apache error|
|2021-06-07 03:17:46|Error|192.88.134.10||AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function x_get_view() in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php:16\nStack trace:\n#0 {main}\n thrown in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php on line 16'||||Apache error|
|2021-06-07 15:21:44|Error|192.88.134.10||AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function x_get_view() in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php:16\nStack trace:\n#0 {main}\n thrown in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php on line 16'||||Apache error|
|2021-06-08 03:32:38|Error|192.88.134.10||AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function x_get_view() in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php:16\nStack trace:\n#0 {main}\n thrown in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php on line 16'||||Apache error|
|2021-06-08 15:36:53|Error|192.88.135.10||AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function x_get_view() in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php:16\nStack trace:\n#0 {main}\n thrown in /var/www/vhosts/____________.com/httpdocs/wp-content/themes/pro/index.php on line 16'||||Apache error|

Hi @samuraicow,

I have just checked your testing site and also accessed the error_log through the FTP, but didn’t find the issue related to the testing site. It will be very difficult to check at the time you are specified when you are getting the issue, I would suggest you consult with a local developer who can check the issue at the specified time.

Hope it helps.
Thanks