Fatal Python error on Windows 10 ModuleNotFoundError: No module named ‘encodings’

I ran into this same issue on Windows 10. Here’s how I fixed it: Open your ‘Environment Variables‘ (Under ‘System Properties‘). In the window that opens, select the ‘Path‘ row, then click the ‘Edit…‘ button. There should be two environment variables C:\Python37-32\Scripts\ and C:\Python37-32\ Then click ‘OK‘ (Make sure to check that these path values … Read more

set_error_handler() doesn’t work for FATAL error

Nope, that’s just a limitation of set_error_handler(); it doesn’t handle all errors. The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called. The register_shutdown_function() and error_get_last() is a decent workaround.

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes)

WordPress overrides PHP’s memory limit to 256M, with the assumption that whatever it was set to before is going to be too low to render the dashboard. You can override this by defining WP_MAX_MEMORY_LIMIT in wp-config.php: define( ‘WP_MAX_MEMORY_LIMIT’ , ‘512M’ ); I agree with DanFromGermany, 256M is really a lot of memory for rendering a … Read more

WordPress Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /wp-includes/wp-db.php:1570

I encountered this problem upgrading from PHP 5 to PHP 7 (on Windows). The problem was mysqli PHP extension was not enabled. If mysqli is not available WordPress 5+ detects this and will instead attempt to connect to the database with deprecated mysql_connect() calls. This leads to a very misleading error message about mysql_connect() function … Read more

Fatal error: Declaration of .. must be compatible with .. PHP

Ishoppingcart::addToCart() states that the method does not take any parameter, while the implementation Shoppingcart::addToCart(Product $product) requires that a parameter of type Product must be passed into the method. This means that both declarations are incompatible and while the implemented interface must be satisfied PHP throws the shown error. Solution would be to either change Ishoppingcart::addToCart() … Read more

How can I catch a “catchable fatal error” on PHP type hinting?

Update: This is not a catchable fatal error anymore in php 7. Instead an “exception” is thrown. An “exception” (in scare quotes) that is not derived from Exception but Error; it’s still a Throwable and can be handled with a normal try-catch block. see https://wiki.php.net/rfc/throwable-interface E.g. <?php class ClassA { public function method_a (ClassB $b) … Read more

PHP Fatal error: Cannot access empty property

You access the property in the wrong way. With the $this->$my_value = .. syntax, you set the property with the name of the value in $my_value. What you want is $this->my_value = .. $var = “my_value”; $this->$var = “test”; is the same as $this->my_value = “test”; To fix a few things from your example, the … Read more