Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unpacking the package… Could not create directory. Wordpress, Apache2, Ubuntu

This question could be all around but I have tried most answers and permission 777. But, still no luck.

/etc/apache2/sites-available/mysite.conf

<VirtualHost *:80>
        ServerName www.mysite.com
        ServerAdmin [email protected]
        DocumentRoot /var/www/html/wordpress
        ErrorLog ${APACHE_LOG_DIR}/mysite_error.log
        CustomLog ${APACHE_LOG_DIR}/mysite.log combined 
</VirtualHost>

/etc/vsftpd.conf

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
allow_writeable_chroot=YES

I set permission 777 to /usr/share/wordpress and /var/lib/wordpress.

like image 352
Lwin Htoo Ko Avatar asked Dec 14 '25 07:12

Lwin Htoo Ko


1 Answers

The update creates a directory in wp-content/update inside the site directory. Linux does not set permissions automatically of child directories to those of the parent. Therefore wp-content/upload will not necessarily have 777 permissions.

Try change permissions of wp-content/update to 777. If this works it means that the owner of the WordPress folders is not the the user trying to update the site.

What worked for me was to add my ftp client to the group that the owner of the WordPress process. (How do I know which linux user Wordpress uses for plugin installation) to find the owner. and then set all directories to 775 permissions and files to 665 in the site directory.

chmod 775 $(find -type d)
chmod 665 $(find -type f)
like image 124
paddatrapper Avatar answered Dec 16 '25 23:12

paddatrapper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!