Craft CMS Asked by BBaysinger on April 30, 2021
In Craft 3.2.10, I’m getting this error message when I try to upload an image asset:
Upload failed. The error message was: “Impossible to create the root
directory “/Users/me/Work/Client/repo/web/craftcms-assets/project-slide-photos”. mkdir():
Permission denied”
I’ve made the permissions for project-slide-photos
to 777 and 774, and likewise tried both for the parent directory. Is it trying to create a directory that’s already there? I tried removing project-slide-photos
also, and it still doesn’t work.
What do I need to do to make my assets upload into this directory?
Edit: Wondering if using Docker Compose could have something to do with this:
docker-compose.yml
:
version: '3'
services:
web:
image: 'flipbox/php:72-apache'
ports:
- '80:80'
- '443:443'
volumes:
- '.:/var/www/html/'
environment:
ENVIRONMENT: dev
DB_SERVER: db
DB_USER: craft
DB_PASSWORD: craft
DB_DATABASE: craft
XDEBUG_ON: "yes"
XDEBUG_HOST: "host.docker.internal"
XDEBUG_IDEKEY: "PHPSTORM"
APACHE_DOCUMENT_ROOT: "/var/www/html/web"
db:
image: 'mysql:5.7'
restart: always
ports:
- '3306:3306'
volumes:
# Location to import a database dump.
- ./src:/docker-entrypoint-initdb.d
# Location of the generated mysql files.
- ./mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: craft
MYSQL_USER: craft
MYSQL_PASSWORD: craft
I understand now within the context of you are using docker. Since docker creates a new file system separate from your computer's file system, you will want to run these commands on the docker instance.
I do not use docker regularly, but I believe you can use docker attach
while the droplet is running to access the droplet's file system.
You will want to set the parent folder to have higher privileges. Try this command:
chmod 774 craftcms-assets
Privileges are composed of three numbers: self, group, and world. There are also three access levels: read, write, and execute. 7 will give access to read, write, and execute. You will want to use 7 for your own commands (self) and for craft's commands (group), but not for the general public (world).
Hope this helps!
Correct answer by Clark Nelson on April 30, 2021
Since this is the top result on Google for this error, I wanted to add that what fixed it for me (a non-docker user) was setting the permissions for the "/assets/images" directory to 775.
Craft's documentation says to set certain folders to 774, but evidently it needs that Public Execution permission for the system to recognize it.
Answered by MisterCritter on April 30, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP