How to fix AH01071: Got error PHP message caused by wordfence-waf

The error message “PHP Fatal error: Failed opening required” typically indicates that a PHP file cannot be found or accessed. This can be caused by various factors such as file path changes, permission issues, or missing files. Here are some possible causes and solutions you can make use of:

File Path Changes

If the site’s file path structure has changed, the PHP file may not be found. This can occur after moving the site from one cloud hosting provider to another. For example, to fix this in the case of a WordPress website, the file path structure needs to be reverted manually. You can do that by editing the .user.ini file using a text editor or a web hosting panel like Plesk or CPanel. You can also use Webmin to edit files if you are not comfortable using text editors like Nano or VIM.

Note: Wordfence-WAF is a plugin keeps a constant eye on your WordPress site, watching out for any shady traffic trying to mess with it. Whenever it spots a fishy request, it steps in and blocks it before it can do any damage. This means you can rest easy knowing your site’s safe from hackers and other online threats assuming it is set up properly.

Permission Issues

In essence, permission issues can arise when the file containing the PHP script lacks the necessary permissions for the web server to access and read its contents. To ensure seamless execution, the file’s permissions should be set to ‘444’, which grants read-only access to all users, including the web server. This prevents unauthorized modifications to the script and ensures that only the intended user can interact with it.

Increase PHP Memory Limit

In certain instances, attempting to load files whose size surpasses the allocated memory can trigger the dreaded ‘failed to open stream’ error. To combat this, consider expanding the PHP memory limit to accommodate larger file operations. This enhancement empowers PHP to handle resource-intensive tasks without succumbing to memory constraints. By increasing the memory allowance, you effectively grant PHP the freedom to operate seamlessly with larger files and avoid the frustrating ‘failed to open stream’ error altogether.

Missing Files

If the required PHP file is missing, the whole operation will come to a screeching halt! Therefore, make sure to check that the file indeed exists in the specified directory, mate. And suppose you encounter any further issues don’t forget to examine your server logs for any additional information about the error. The error message you provided seems to be from Apache logs. Check both Apache and PHP logs for more details on the issue.