Question

There has been a critical error on your website.

Posted March 8, 2020 1.3k views
WordPress

Hi,

I have updated ubuntu 16.04, php 7.4.3 after lots of issues finally my website started but now i got one more following issue

“There has been a critical error on your website.” i search some solutions in internet but still not solved.

can any one help me out.

Regards,
Raja

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hi @rajviswas,

It seems you have some error in your code or there is a PHP extension missing. There are a few ways to check this however, I’ll recommend the following two.

  1. Enable PHP error logging using php.ini
  2. Enable the PHP errors via the index.php file.

Let’s start with the first point.

cd /path/to/you/website

If you have an php.ini file there open it, if you don’t create one

nano php.ini

for creating a new php.ini type in

touch php.ini && nano php.ini

In there add the following lines

; log PHP errors to a file 
log_errors = on
error_reporting = 32767
error_log = /path/to/you/website/error_log

Please note to change the /path/to/you/website/errorlog with the actual one. Restart your apache and open your website. You should now have an errorlog file in your website’s directory stating what the error is. From there you can act on.

The next solution is a bit easier. Open your index.php file and add to the top right under the <?php tag the following line

ini_set('display_errors', 1);

This should show the error you are experiencing directly in the browser. As soon as you’ve added the above line, save the file and open your website via the browser. You’ll see the error there.

Once you have resolved the error, it’s important to remove the above line.

Regards,
KDSys

  • Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 65536 bytes) in /home/paumil/public_html/bc/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/ProductsByAttribute.php on line 15

    Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 65536 bytes) in /home/paumil/public_html/bc/wp-includes/class-wp-recovery-mode.php on line 169

    Now how to change the memory limit to 256MB ?

  • Hi,

    I have tried as mentioned methods but no change again same problem

In Cpanel I found Multi PHP Ini editor and made changes

32 M to 256 M and the error resolved.

  • Hi @paumil,

    I’m glad to hear the error has been resolved.

    Yes, the

    Fatal error: Allowed memory size of
    

    is resolved by increasing the PHP memory limit. I didn’t know you where using cPanel otherwise I would have provided you with steps how to resolve this directly from it.

    Regards,
    KDSys

Submit an Answer