Fix open () Critical Error: 13: Permission denied - Upload Images Error in WordPress

WordPress is a very flexible system that allows users to create very fast from a simple blog to an advanced presentation website or an online store.
Like any system, it's not without problems. Most often, web hosting offers are optimized for either a small number of users or are not configured according to users' needs. For an advanced website created on WordPress we recommend it to use Dedicated Servers with services specifically configured for WordPress.

One of the most common errors on a blog / website created with WordPress is the impossibility of uploading media files. HTTP Error. If you have enabled an "error.log" on the server, when trying to upload an image, the error will look something like this:

"date" [crit] 16324#16324: *119467 open() "/home/path/public_html/" failed (13: Permission denied), client: IP, server: website.com, request: "GET / HTTP/1.1", host: "website.com"


This error is encountered not only when trying to upload a media file to the server, but also when the website is accessed by users, and there are scripts on the web page that are not allowed on the server to be opened. Therefore, this error is related to the permissions of the files and folders on the host server. "chmod"And"chown".

How to resolve error: open () Critical Error: 13: Permission denied

1. First of all we need access FTP or SSH the server. We connect and navigate to the directory where we find the folder where the web site files are. In our example this is: "public_html".

2. If we use an SSH connection, in the directory where we reached the 1 point, we execute the command lines:

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

chown -R user:group *
The first command line will look for you all files found in the current and recursive folder, and set 644 permissions. The second command line will do the same, but only for directories. It will set them 755 permission.
In the third command line, the user and the group to which the files belong change. Most of the time it is of the form: “apache: nobody” for web servers with HTTPD / Apache or “nginx: nginx” for servers with NGINX.

After executing these command lines, the error "open () Critical Error: 13: Permission denied"It should disappear. If you have questions or concerns, do not hesitate to leave them in the comments.

Fix open () Critical Error: 13: Permission denied - Upload Images Error in WordPress

About the author

Stealth

Passionate about everything gadget and IT, I write with pleasure on stealthsettings.com since 2006 and I like to discover with you new things about computers and operating systems macOS, Linux, Windows, iOS and Android.

Leave a Comment