Image Up Error on Mac Local WordPress

Asked 2 years ago, Updated 2 years ago, 38 views

I put WordPress locally on Mac OSX Yosemite and test it.
I set up a virtual host in the subfolder of the Site folder.
So when I upload images from WordPress' media library, I get the following error

Create directory wp-content/uploads/2015/02 failed.Does this parent directory have permission to write to the server?

The other day, I moved my Mac and there was no error on the old Mac, but it started to come out after I moved to the new Mac.
I think the permission is the same as the old one.
I thought it might be the owner's problem, so I created a new folder and put down WordPress download (just like I did on my old Mac), but it appears as follows during installation.

 Unable to write to wp-config.php file.

I can still install it, but I get the same error when I upload the image.
What was the reason why I couldn't do what I used to do with my old Mac?

macos

2022-09-30 19:39

1 Answers

I think it's a permission error.
As a trial, you can back up the uploads folder, access the folder at the terminal, and then tap the following command to confirm that it can be uploaded successfully.

$cd/~(site folder)/wp-content/
$ sudo chmod-R777 uploads/ 

Undo the backup, verify the user of the directory where wordpress is installed, and

$cd/~(site folder)/
$ ls-la
$ sudo chown-Rapache:apache (site folder)

If it's local, you may be using Mamp, so
  If you are a regular user instead of nginx or apache, change it.


2022-09-30 19:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.