How to fix Fatal error: require_once(): Failed opening required '…/easy-contac
-
I wanted to post this solution, in case anyone else was having the same issue I was.
I installed some WP Security plugins that renamed the default wp-content directory to make my site more secure. This caused the following error when accessing pages using my Easy Contact Form:
Warning: require_once(/home2/YOUR-WEBSITE-NAME/public_html/wp-content/plugins/easy-contact-forms/easy-contact-forms-utils.php): failed to open stream: No such file or directory in /home2/YOUR-WEBSITE-NAME/public_html/NEW-PREFIX-content/plugins/easy-contact-forms/easy-contact-forms.php on line 275 Fatal error: require_once(): Failed opening required ‘/home2/YOUR-WEBSITE-NAME/public_html/wp-content/plugins/easy-contact-forms/easy-contact-forms-utils.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home2/YOUR-WEBSITE-NAME/public_html/NEW-PREFIX-content/plugins/easy-contact-forms/easy-contact-forms.php on line 275
The plugin seems to know that the directory was renamed, but still can’t find the file.
In order to fix this, you will need to open the easy-contact-forms.php file in your favorite code editor. It will be located in your new directory, probably something like this:
/home2/YOUR-WEBSITE-NAME/public_html/NEW-PREFIX-content/plugins/easy-contact-forms/easy-contact-forms.php
Find the following lines:
Line 107 DEFINE(‘_EASYCONTACTFORMS_DIR’, ‘wp-content/plugins/easy-contact-forms’);
Line 265 DEFINE(‘_EASYCONTACTFORMS_DIR’, ‘wp-content/plugins/easy-contact-forms’);and change wp-content to your new directory name. Save your changes and your form should work again.
- The topic ‘How to fix Fatal error: require_once(): Failed opening required '…/easy-contac’ is closed to new replies.