Closed
Description
Here is my docker-compose file:
web:
image: wordpress:php7.3
restart: always
volumes:
- ./web:/var/www/html
environment:
- WORDPRESS_DB_HOST=db
- WORDPRESS_DB_USER=exampleuser
- WORDPRESS_DB_PASSWORD=examplepass
- WORDPRESS_DB_NAME=exampledb
links:
- db:db
db:
image: mysql:5
restart: always
environment:
- MYSQL_ROOT_PASSWORD=sdfwesd342sdfsdgSfk
- MYSQL_DATABASE=exampledb
- MYSQL_USER=exampleuser
- MYSQL_PASSWORD=examplepass
volumes:
- ./db:/var/lib/mysql
I mounted the whole /var/www/html
.
The file permissions are correct:
root@ca:~/sites/web# ll
total 212K
drwxr-xr-x 5 root root 4.0K Jan 29 17:32 .
drwxr-xr-x 5 root root 4.0K Jan 29 17:26 ..
-rw-r--r-- 1 www-data www-data 235 Jan 29 17:28 .htaccess
-rw-r--r-- 1 www-data www-data 418 Sep 25 2013 index.php
-rw-r--r-- 1 www-data www-data 20K Jan 29 17:33 license.txt
-rw-r--r-- 1 www-data www-data 7.3K Jan 29 17:33 readme.html
-rw-r--r-- 1 www-data www-data 6.8K Dec 13 09:30 wp-activate.php
drwxr-xr-x 9 www-data www-data 4.0K Jan 10 02:32 wp-admin
-rw-r--r-- 1 www-data www-data 364 Dec 19 2015 wp-blog-header.php
-rw-r--r-- 1 www-data www-data 1.9K May 3 2018 wp-comments-post.php
-rw-r--r-- 1 www-data www-data 2.8K Jan 29 17:33 wp-config-sample.php
-rw-r--r-- 1 www-data www-data 3.2K Jan 29 17:32 wp-config.php
drwxr-xr-x 6 www-data www-data 4.0K Jan 29 17:33 wp-content
-rw-r--r-- 1 www-data www-data 3.6K Aug 20 2017 wp-cron.php
drwxr-xr-x 19 www-data www-data 12K Jan 10 02:32 wp-includes
-rw-r--r-- 1 www-data www-data 2.4K Nov 21 2016 wp-links-opml.php
-rw-r--r-- 1 www-data www-data 3.3K Aug 22 2017 wp-load.php
-rw-r--r-- 1 www-data www-data 37K Dec 13 08:28 wp-login.php
-rw-r--r-- 1 www-data www-data 7.9K Jan 11 2017 wp-mail.php
-rw-r--r-- 1 www-data www-data 18K Oct 23 15:04 wp-settings.php
-rw-r--r-- 1 www-data www-data 30K Apr 30 2018 wp-signup.php
-rw-r--r-- 1 www-data www-data 4.6K Oct 24 2017 wp-trackback.php
-rw-r--r-- 1 www-data www-data 3.0K Sep 1 2016 xmlrpc.php
When I click the upgrade
or re-install
wordpress button in the Updates
menu of the dashboard of the workdpress, it requires me to input a Ftp user/password to.
I checked the web root folder and wp-content
permissions, they are all correct( xrw
for the www-data
user)
So I add the following line to wp-config.php
define('FS_METHOD', 'direct');
Then the upgrade button can work now.
what's wrong here? Is there anyone have the same problem ?
Thanks in advance.