The FTP credential needed when trying to update WordPress is really annoying. However, to fix that problem is easy. It is related to file and folder ownership and permissions.
File and Folder Ownership
We need to change the file and folder ownership to
www-data. Apply for both user and group otherwise it won’t work.
Usually the folder of web server directory in Linux is
/var/www/yourweb.com/public_html/ we need to change the ownership on public_html itself and files and folders inside it to
$ cd /var/www/yourweb.com/
$ chown -R www-data:www-data *
File and Folder Permission
Same as above, we need to change the file and folder permissions for both public_html and files and folders inside it. But, isn’t it difficult to change those things one by one?
Therefore, we created a guide to change the file and folder permissions recursively in an easy way. For files you need to change the permission to 755 and for folders 644.
Let us know if you still have problem.
I’ve discovered the hidden treasure at superuser to change the permission of directories or files recursively in a folder. Not quite simple, but straight. To recursively give directories read & execute privileges:
Continue reading Changing Directory and Files Permission Recursively in Linux
Few days ago, I got troubled by some unethical hackers. They’re changing my directories and files permission to 777 which has ability to World-read-write-execute. That kind of permission is very dangerous. I don’t know how did they get into my cPanel File Manager. I thought it was WordPress, WordPress plugins, or WordPress theme failure, so they could inject malicious script into my public_html directory easily and freely.
I’ve ask HostGator using live chat support but one of them has said that I can’t change the permission of files or directories massively even using SSH. That’s totally wrong because few hours later after that, I found the way. Basically, you have to know how to connect to your hosting using SSH. I’ve created a tutorial how to connect HostGator using SSH.
Continue reading How to Change Permission of wp-config.php and Other Files/Directory Massively