4

I'm using amazon web services to host my Ubuntu Lamp stack and I'm new to this (of course).

I installed LAMP and wordpress to use for my website using this tutorial:

http://iampuneet.com/wordpress-amazon-ec2/

I have completed this and everything seems to be running smoothly. I have access to the wordpress dashboard and I am attempting to upload a theme I purchased. Now when I go to upload the theme I get this error:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

So I'm trying to add a php.ini file that increases the max upload size, however when I try to move the file into the /var/www/wp-admin directory I get this error:

Error:  /var/www/wp-admin/php.ini: open for write: permission denied
Error:  File transfer failed

I am using an EC2 instance on AWS, Host: my ip address, Username: ubuntu, no password and port 22

Any idea what may need to be done here? I have tried numerous ideas from Googling this issue.

2 Answers 2

1

Even as the ubuntu user, you cannot write to a directory owned by root.

If you want to do this, you will first have to upload your files to your home directory (i.e. /home/ubuntu/).

From there, you need to SSH into your system, login, then do sudo cp /home/ubuntu/FILENAME /var/www/wp-admin/FILENAME or whatever the command you need to do is, replacing FILENAME with the actual file's name. As well, if you are not copying to /var/www/wp-admin remember to use the correct path instead.

13
  • Thank you, now how do I upload the files to my home directory?
    – anthony
    Sep 6, 2013 at 0:05
  • Well, I just gave you the directory to upload to for the ubuntu user: /home/ubuntu. If the username is something else, say, ant, then the home directory is /home/ant/.
    – Thomas Ward
    Sep 6, 2013 at 4:17
  • Hey thanks i understand this now. But, the file I was trying to upload did not solve the problem, can I do it with the entire theme instead? Upload to ubuntu then copy to var/wp-content/themes?
    – anthony
    Sep 6, 2013 at 23:15
  • Yes, you should be able to do that, however if you are having issues with permissions or files on wordpress, you might want to get help from a more specific site, such as the WordPress Answers site here on stackexchange. Ask Ubuntu is good for helping to resolve issues with the Ubuntu OS, but not necessarily wordpress issues.
    – Thomas Ward
    Sep 6, 2013 at 23:21
  • ok I will head over to their forum then, thanks Thomas
    – anthony
    Sep 7, 2013 at 0:24
0

I got into this topic because I ran into the same problem.

When I tried to copy files to the server in the /var/www/html/ Filezilla answered me that permission denied. I also needed to create additional folders. And the answer is the same - permission denied.

In search of answers through Google, I found that through SSH I should change access to folder /var/. I've lost a lot of time on this. And it was not necessary.

The solution was simple:

I just needed to connect in Filezilla by SFTP connection on root user.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .