WordPress frequently receives bug fixes and security updates that make it a pretty stable website management system. Even after that, in many cases, users may encounter some issues with WordPress that immediately pulls down website content from the internet and show a frustrating error.
One of the biggest challenges in fixing such errors is finding the root of the error. Many times users have installed 20 or even 30 plugins that make it more complicated to find the actual cause of the error.
In this article, I will discuss and provide a fix for one of such critical WordPress errors, No input file specified.
No input file specified WordPress
The WordPress No input file specified error mostly occurs when the user migrates the website from one server to another.
Website migration can cause various issues if not planned correctly. I will write a complete guide for migrating the WordPress site to a new server. But for now, let us focus on this specific error.
At this point, the user needs to remember the changes that he recently made on the website and compare it with the reasons I am mentioning below. In most cases, making the following tweaks will fix the issue. If not, let me know in the comment section. I will help you out.
- Broken plugin
- Error with Caching and Firewall plugin
- .htaccess
- Incorrect PHP version
- Incorrect file permissions
Broken plugin
Most of the time, manual migrations cause certain files from backup to fail to upload correctly on the new server. Or maybe just a plugin update caused the site to stop loading because of errors in the code.
In this case, we need to find a broken plugin. To find the broken plugin, we can deactivate all the plugins one-by-one. Each time we deactivate a plugin, reload the site to check if that fixed the error or not.
WordPress plugins can be deactivated without accessing the WordPress admin dashboard. For this, we need to access the server’s file system and rename the directory of the plugin we want to deactivate.
All the plugins directories are stored in wp-content >> plugins. To access the file system, one can either use an FTP client such as Filezilla or use cPanel’s file manager.
If your WordPress is hosted on Hostgator, GoDaddy, Bluehost, or any other shared hosting services, they all provide cPanel for easy management of the site. So you can use cPanel’s file manager and move into WordPress installation where you’ll get a wp-content
directory. Inside it, there is a plugins directory that contains all plugins data. Each folder here represents an active plugin. To deactivate a plugin, just rename the directory.
For example, to deactivate the AMP plugin, we can rename the plugin’s amp directory to ‘amp-disabled’. Once it is confirmed that AMP is not the corrupted plugin, we can rename it back to amp to reactivate it.
Note
If you opt to use FTP, use FileZilla, and log in to your server remotely.
Usually, hosting services send FTP account credentials in the welcome email. If you did not receive FTP credentials in the welcome email, contact your hosting company and ask them to provide FTP account credentials.
Similarly, we will deactivate all plugins one by one and check which plugin fixes the issue. Once you have found the corrupted plugin, keep it deactivated.
Error with Caching and firewall plugins
When deactivating plugins, it is better to start with caching and firewall plugins. There is a high chance that there is an issue with any of these plugins.
If cache plugins are not set up correctly, the website may fail to load correctly or not load at all. So to keep the migration process smoother and successful, I recommend deactivating the cache plugin before the migration.
.htaccess
.htaccess is an important file that keeps WordPress functioning properly. No input file specified error can be caused due to a corrupted .htaccess file.
.htaccess file exists in the root of WordPress installation. Plugins can heavily modify .htaccess files, especially firewall plugins. After you have deactivated cache and firewall plugins, restore the .htaccess file to its original state. First of all, make a backup of the current .htaccess file, then paste the following content in .htaccess file.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
For more information on WordPress .htaccess file, please refer to this WordPress guide.
Incorrect PHP version
Another reason that may cause WordPress no file input specified error could be the incorrect PHP version. If the user has migrated WordPress to a server that has an older version of PHP, then it can also cause the error.
To update the PHP on Ubuntu 16.04, 18.04, or 20.04, add the following repository to your server –
sudo add-apt-repository ppa:ondrej/php
sudo apt update
If you have cPanel hosting, then there must be an option to switch between PHP versions. If you can not find the option, contact the support team and they will help you out.
File permissions
One of the reasons that WordPress stops functioning properly is by setting incorrect file permissions. Incorrect file permissions will not only make the website unstable but also insecure. It is extremely important to check WordPress file permissions even if the website seems functioning properly.
No input file specified error also occurs when WordPress files do not have correct permissions.
WordPress file permissions
Remember to set the following permissions after website migration –
- All directories should have ownership of an actual user account.
- All Folders or directory permissions should be 755 or 750
- All Files permissions (except for wp-config.php) should be 644 or 640
- wp-config.php permissions should be 440 or 400
- Double-check that no file has 777 permissions (for security purposes)
Summary
In most cases, making the above changes to your WordPress installation will fix the error. If you are reading this article before initiating the migration process, please uninstall the cache plugin, all the deactivated plugins, and deactivated themes from the site.
I will write a complete guide for WordPress migration process. I see people often commit mistakes during migration that causes them a lot of trouble. Before migration, proper planning is extremely important. You can migrate your site between servers with zero-downtime if you have a little more knowledge. I will discuss all the important points in another article.
from LinuxAndUbuntu – Linux Tutorials, FOSS Reviews, Security News https://ift.tt/2Fn0yOQ
0 Comments