Reputation: 1
I have a site on Hostgator server, domain and hosting both with Hostgator self hosted wordpress hosting. Suddenly it hit error few days back, instead of loading normal home page its showing FTP client login and fatal error message below. Before contacting host, I deactivated plugin but not resolved even I entered following code in wp-config.php
file define('FS_METHOD', 'direct');
I contacted host, to solve the issue but still they are unable to diagnose the issue, instead they restored site to previous 3 days version when site was working , but this also not solved issue. Also checked with SITE LOCK for malicious code, but found nothing.
Is there any solution that can solve this issue.
Notes:
If site admin logged through mysite.com/wp-admin and browsing mysite.com it loads properly. Even after getting error, CTRL+F5 solves this issue and site loads without any issue. Issue with non logged end users
This is very strange behaviors.
Screen shot attached below
Upvotes: 0
Views: 6044
Reputation: 1
Should I have to use /home1/wad4gc0acmry/public_html/wp-content/ instead '/home1/wad4gc0acmry/public_html/my-site.example.com/wordpress/wp-content/'
Kindly advise!
As per webhost PHP process is running under 511 user and that user and others have enough permissions to the WP Site.
I have integerated following your code; with CHANGE of actual values of 1) FTP_USER, 2) FTP_PASS, 3) FTP_HOST and 4) my-site.example.com
define('FS_METHOD', 'direct');
define('FTP_BASE', '/home1/wad4gc0acmry/public_html/my-site.example.com/wordpress/');
define('FTP_CONTENT_DIR', '/home1/wad4gc0acmry/public_html/my-site.example.com/wordpress/wp-content/');
define('FTP_PLUGIN_DIR ', '/home1/wad4gc0acmry/public_html/my-site.example.com/wordpress/wp-content/plugins/');
// define('FTP_PUBKEY', '/home1/username/.ssh/id_rsa.pub');
// define('FTP_PRIKEY', '/home1/username/.ssh/id_rsa');
define('FTP_USER', 'my-ftp-username');
define('FTP_PASS', 'my-ftp-password');
define('FTP_HOST', 'ftp.my-site.example.com');
// define('FTP_SSL', false);
At currently site is working for normal users, but i am not confirm if the issue will hit again as this is producing periodically. In case it will hit again, I will update accordingly.
Thank you very much! juhi
Upvotes: 0
Reputation: 356
Go through the below two possible ways to solve this issue.
Way-1: Add the following FTP information to your wp-config.php
define('FS_METHOD', 'direct');
define('FTP_BASE', '/home1/wad4gc0acmry/public_html/my-site.example.com/wordpress/');
define('FTP_CONTENT_DIR', '/home1/wad4gc0acmry/public_html/my-site.example.com/wordpress/wp-content/');
define('FTP_PLUGIN_DIR ', '/home1/wad4gc0acmry/public_html/my-site.example.com/wordpress/wp-content/plugins/');
// define('FTP_PUBKEY', '/home1/username/.ssh/id_rsa.pub');
// define('FTP_PRIKEY', '/home1/username/.ssh/id_rsa');
define('FTP_USER', 'my-ftp-username');
define('FTP_PASS', 'my-ftp-password');
define('FTP_HOST', 'ftp.my-site.example.com');
// define('FTP_SSL', false);
Way-2: Give permissions to your wordpress site folder.
First check PHP process is runing under which user by using the below command
ps aux | grep php
For EX: user is "http" and run the below command.
$ sudo chown -hR http:http PATH_TO_YOUR_WORDPRESS_FOLDER
Upvotes: 5