I created a caddy based WordPress installation on Ubuntu 20.04 using the last caddy version.
The caddyfile is simple:
domain.xx {
tls admin@domain.xx
root * /var/www/domain.xx/
php_fastcgi unix//run/php/php7.4-fpm.sock
encode gzip
file_server
}
I am facing issues with
a) uploading media files
b) installing/deleting plugins
c) deleting themes (and so surely also adding themes)
Following user/group rights are assigned:
var/www/domain/ → www-data:ww-data rwxrwxr-x (0755)
var/www/domain/wp-content → www-data:ww-data rwxrwxr-x (0755)
Same applies to wp-content sub-directory plugins, uploads and themes
Caddy is assigned to group www-data
I also tried:
chown -R caddy:www-data /var/www/domain/wp-content/ → meanding caddy:www-data (0755)
I added the following line to wp-config.php:
define( ‘UPLOADS’, ‘wp-content/uploads’ );
So I was fixing the issue that no media files could be uploaded.
BUT!
I am facing similar issue with themes and plugins.
Only FTP is possible:
“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 am confused.
Which user and which goup I should set recursively on /var/www/domain/wp-content/
Which user I should add to which groups?
I saw a solution here:
To be able to upload without FTP they claim you should add the following line to config.php:
define(‘FS_METHOD’, ‘direct’);
But again no success!
Any advice?
What I need to change to be able WordPress has full file access to /wp-content ?