docker-wordpress icon indicating copy to clipboard operation
docker-wordpress copied to clipboard

WP_CONTENT_DIR outside ABSPATH

Open franciscof5 opened this issue 1 year ago • 3 comments

Hello, Trying to understand why set WP_CONTENT_DIR outside ABSPATH, because it is not working well, the file uploads keeps sending files to /usr/src/wordpress/w-content

not

/var/www/wp-content

franciscof5 avatar Jan 23 '24 03:01 franciscof5

Hi @franciscof5 ,

It's because the WordPress source is on a different location than the wp-content folder. That makes it possible to update WordPress in this container without affecting the things that live in in wp-content. I don't know why this is an issue for uploading files. It works on the WordPress websites where I'm using this Docker container. How are you uploading the files?

TrafeX avatar Feb 10 '24 15:02 TrafeX

I think if you try an to use the image instead of building the project it will not work properly (I am running multiples wp, so it safe a lot of disk space), for me I have to set the volume as an absolute path:

image: trafex/wordpress
volumes:
  - /var/www/PATH/PATH/wp-content:/var/www/wp-content

franciscof5 avatar Feb 14 '24 19:02 franciscof5

The absolute path you use in the docker compose config doesn't have anything to do with the ABSPATH constant. In docker compose you can use a relative path, but when you use Docker directly it always requires an absolute path.

TrafeX avatar Feb 21 '24 08:02 TrafeX