[Solved] Fatal error: Maximum execution time of 30 seconds exceeded in \wp-includes\class-http.php on line 1078
If, while updating your WordPress website, you encounter an error like this one:
Fatal error: Maximum execution time of 30 seconds exceeded in [website url]\wp-includes\class-http.php on line 1078
It means that the maximum script execution time is exceeded. This parameter can be changed in the php.ini configuration file. However, this is should not be the right way to go, due to negative consequences on the server performances. The good news is that there is another simple way to solve the issue, and it does not have any performance side effect. You just need to add the following code to the beginning of the \wp-includes\class-http.php file :
In this way, for this page only (and not sitewide) the time limits are stretched and you can update your website without any further error. A closing note: the edit of WordPress core files might produce fails in the case you perform integrity check against the default version of the file when running the Site Health tool. If prompted to restore the original version of the file, doing so will remove the performed edit. In any case, after the update, it is completely safe to undo the change.