WordPress can't upload any images to Webserver on AWS Linux - wordpress

I have setup my first ever AWS instance of Linux and installed Apache and MySQL. Put WordPress on it, and got everything installed through FTP, although, I can't seem to upload files within WP itself. That includes new plugins and media uploads.
I have checked the perms of the folder 'wp-content' multiple times and set them to 777 and 775 through both FTP and SSH.
I have checked multiple tutorials and fixes for this but none seem to work. I have created a new SSH/FTP user for my Linux install but WordPress does not like private key files and just wants passwords.
I need help! I don't know what to do next and I don't want to mess this one up.

For debug, I would:
Lock down the AWS security zone to allow HTTP/S access from your IP only
At the Linux cmd prompt:
sudo chmod -R /var/www/html 777
(this unlocks your top-level dir to make it writeable), then try uploading through WP again. If that solves the problem then you can lock back down with 755 when finished and change the AWS security zone back to allowing world access to HTTP/S ports.

Related

Giving write permission back to Wordpress on AWS EC2 via PuTTY

I recently had a PHP syntax error that crashed my server after using the plugin editor on my Wordpress website. It is an AWS Elastic Beanstalk hosted website, so I had to use PuTTY to change the file permissions and allow ec2-user to read/write durring SFTP via Filezilla.
I am not experienced with his sort of thing and followed the information from this question to accomplish this task.
Everything went well, but now I cannot edit or "write" anything via my Wordpress website. No plugin updating, no file editing, nothing. It says I need to change my permissions.
Due to my lack of knowledge on this, I have no idea how to reverse what I did when I entered
chown -R ec2-user /var/app
chmod -R 755 /var/app
How do I set the permissions back so I can edit files and update plugins via Wordpress admin?
EDIT: I found out that all I did was change ownership of the files to ec2-user. SO I guess my new question is how do I find out what username to use for my WordPress site to give it back ownership of the files?
Fixed:
I wound up adding
echo(exec("whoami"));die();
to the top of my WordPress index.php file to figure out the user. Make sure to remove it once you're done.
Lets say my username wound up being "foo".
After I had the username, I went back into PuTTY, and ran
sudo chown -R foo /var/app
and can now modify files through wordpress again.

No Write Access on Wordpress Folder permissions for Bitnami running on AWS

I recently migrated my Wordpress sites to Bitnami on Amazon Web Services. Everything it up and running from the user's perspective, but I'm struggling with a minor permission issue with the themes folder. When I download (or upload my own) theme, it doesn't have write permissions. Bitnami has this as the default for security purposes but when I had my stuff hosted at GoDaddy, this issue never came up.
The odd time I like to go and edit a theme file directly from Wordpress. I also have a File Manager plugin installed that I'll sometimes use instead of FTP to upload theme files.
I can manually change the permissions, either in FileZilla or using SSH but my curiosity and stubbornness would like to have write permission by default on any themes, new or existing.
Do I need to edit a config file somewhere to make this happen?
You need to connect to your server via SSH and execute the commands below described in order to assign correct permissions definitively:
sudo chmod -R g+w /opt/bitnami/apps/wordpress/htdocs/wp-content
sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/wp-content
Then check again if your themes works as you expected.
You can read our documentation to clarify all this situation: https://docs.bitnami.com/general/apps/wordpress/

FTP permissions differ from client to wordpress frontend

Running Centos 6, apache, MySQL and vsftpd. I am trying to upload a plugin to WordPress via its web frontend. I made a user on centos and vsftpd that would coordinate, added them to the same group (apache:apache) and but when I try and upload it I get the unpacking the package, could not create directory error. I've change permissions from as the come to 777 (w/ -R) as well as checked that user groups are in sync. I've even gone and changed the user and group to make them the same as the login for the FTP. Here is the issue. If I login via a direct FTP client or over CLI, I don't have any issues and I checked that the users are the same, permissions, etc. I even added define('FS_METHOD','direct'); to give it a go. All to no avail. I'd really like your thoughts. Hosted here so full root access is not an issue.
Try the following - usually works:
# chown apache:apache {path_to_webroot} -R
# chmod 755 {path_to_webroot} -R

Wordpress permission problems in centOS

I've installed wordpress on Centos (apache) and i was having problems to let wordpress automatically perform certain tasks like updating plugins and making changing to theme files in editor. I studied about permissions in wordpress codex and i made changes to the files permission in my /var/www/html directory. I set all the directories to 0775 and all the files for 0664 but the thing is still not working.
I think that it has something to do with the users. I think that wordpress is not set as the appropriate users to do those tasks. Please tell me what to do.
It sounds like it's an issue with ownership rather than permissions.
Login using SSH.
Run the following command:
sudo chown apache:apache /var/www/html
This changes the ownership of your web root to the web server allowing WordPress to write files (perform automatic updates etc).

Install a theme in local machine. Should I need the FTP data connection?

I have just installed wordpress at my localhost for the first time.
I want to install a theme, and it asks me about my FTP username and password.
It says this: "To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host."
I'm wondering if wp is usually directly installed in the production web server or if it could be installed first in a local machine... What should I do?
Add this to your wp-config.php
define('FS_METHOD','direct');
Due to Linux having such a more restrictive file system, this will enable to you write directly to the folder.
This will solve that ftp problem while installing a new plugin or theme.
On OSX, I used the following, and it worked:
sudo chown -R _www:_www {path to wordpress folder}
_www is the user that PHP runs under on the Mac. (You can change this to whatever your PHP install runs under on your specific OS)
(You may also need to chmod some folders too. I had done that first and it didn't fix it. It wasn't until I did the chown command that it worked, so I'm not sure if it was the chown command alone, or a combination of chmod and chown.)
If WordPress asking hostname and connection details for installing plugin and themes, we need to add a function hook in the wp-config.php file in the home directory.
define('FS_METHOD','direct');
for more details refer the page.
https://support.cloudways.com/how-to-resolve-wordpress-asking-for-ftp-credentials-error/
If you're using your local machine as the install location, instead of using the in-app installer (which is now askign you for ftp details), fire up a browser and download the theme directly from the Theme Directory, unzip it into the themes folder at wp-content/themes/name-of-theme. You can then activate the theme from the admin panels.
See also the instructions at http://codex.wordpress.org/Using_Themes.

Resources