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 user needs. For an advanced website created on WordPress we recommend using it Dedicated Servers with services specially configured for WordPress.

One of the most common errors on a blog / website created with WordPress, it is impossible to upload media files. HTTP Error. If you have activated a "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 the 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.

Passionate about technology, I enjoy writing on StealthSettings.com since 2006. I have a rich experience in operating systems: macOS, Windows, and Linux, as well as in programming languages and blogging platforms (WordPress) and for online stores (WooCommerce, Magento, PrestaShop).

How to » Noteworthy » Fix open () Critical Error : 13: Permission denied - Upload Images Error in WordPress

1 thought on “Fix open () Critical Error : 13: Permission denied - Upload Images Error in WordPress"

Leave a Comment