If you notice fopen no such file or directory error after migrating WordPress site, then you can try these solutions.
The error looks something like this:
Warning: fopen(/home/content/24/8561424/html/ssecurity/wp-content/plugins/woo-nmi-three-step/woocommerce-nmi-three-step.php): failed to open stream: No such file or directory in C:\xampp\htdocs\wordpress\wp-includes\functions.php on line 4848
Warning: fread() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\wordpress\wp-includes\functions.php on line 4851
Warning: fclose() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\wordpress\wp-includes\functions.php on line 4854
You can see that the page is trying to open a file that is not available. If you see carefully, you will notice that the directory is not exactly the current directory where your wordpress is installed. Actually, the directory link of your old server is still saved in the database. That’s why you are seeing the fopen no such file or directory error.
Now let’s solve this problem. I will show you 3 ways to fix the issue.
Solution 1: Deactivate/Reinstall the plugin to fix fopen no such file or directory error
Most of the time the error will be fixed if you just deactivate/reinstall the plugin that is causing the error. What it will actually do is refresh the directory path saved in the database with the current path.
Solution 2: Edit Database to fix fopen no such file or directory error
Go to PhpMyAdmin and select the database you are using. Please backup the database before changing anything. Find the fs_accounts from the option_name column in the ‘options’ table. Edit the ‘fs_accounts’ and you will see the old path is saved there. Just replace the path with the current directory path. Now the fopen no such file or directory error should be fixed.
Solution 3: Remove the ‘fs_accounts’
If the first two solution doesn’t work. You can try by removing the ‘fs_accounts’ row from the table. But in this case, you might have to add some of your saved settings will be lost. You will have to add them again.
Please asked me any questions if you have. And add a comment if it really helps you. Also, let me know if you have any better solution. And contact me if you still face the issue.