Search code examples
amazon-ec2permissionswordpress

WordPress & Plugin version not updating on amazon-ec2


I have a word press site in amazon ec2 instance.I am getting issue with installation and updating the plugin.

Issue:-

1)When i try to install plugin from wp-admin backend.It's show the bellow error so that every time i need to upload the plugin manually on server and then need to activate from wp-admin backend.

Unpacking the package…
Could not create directory.

2)When i try to update plugin & wordpress from wp-admin backend.It's show the bellow error

 Update Plugin
 Downloading update from …
 Unpacking the update…
 Could not create directory.

My word press file permission structure like bellow:-

wp-content-> "755"

plugins-> "755"

plugins->e.g(captcha) "755"

and under the captcha plugin file i have-> "664" permission.

If have any body idea regarding this issue let me know.

the answer will be appreciated.

I have searched through the google but i didn't find any solution.


Solution

  • That mean issue here is that apache does not have access to the folders. The default permission is given to the ec2-user in the AMI. run this in your terminal and you will be ready to go for update,install plugin and wordpress.

    sudo chown -R apache:apache /var/www/html
    

    In case when updating the plugin and word press if wp-admin asking for ftp credential just add the bellow snippet code in wp-config file .

    define('FS_METHOD', 'direct');
    

    and run the command.

    sudo chown -R apache:apache /var/www/html