WordPress needs to access your web server?

It was Thursday night and I decided to learn some new tricks on WordPress. I started to build a test environment using Docker.

Here is my docker-compose.yml file:

version: ‘3.1’
    image: wordpress:5.2.2
    restart: always
      – 8080:80
      WORDPRESS_DB_USER: exampleuser
      WORDPRESS_DB_PASSWORD: examplepass
      WORDPRESS_DB_NAME: exampledb
    working_dir: /var/www/html
        – ./src/:/var/www/html/
    image: mysql:5.7.25
    restart: always
      MYSQL_DATABASE: exampledb
      MYSQL_USER: exampleuser
      MYSQL_PASSWORD: examplepass
      – db
    image: phpmyadmin/phpmyadmin
    restart: always
      – 5432:80
      PMA_HOST: db

Then started my Terminal, and located the folder that my yml file stored, with the command:

docker-compose up -d

Everything went pretty smoothly. WordPress installed! Now I went to the second step and tried to install plugins and here comes the warning:

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.

Googled this issue around and found the most simple and useful solution:

Add the following to wp-config.php:
define( ‘FS_METHOD’, ‘direct’ );

Problem solved!!! Happy end. Alright, time for a coffee break.

Share This