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 a "error.log" on the server, when trying to upload an image, the error will look like this:

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

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 on the web page there are scripts that do not have permission on the server to be opened. So this error is the file and folder permissions on the host server. "chmod"And"chown"

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

1. First of all we need access FTP or SSH to 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 it changes the user and the group to which the files belong. In most cases, they are like "apache: nobody" for web servers with HTTPD / Apache or "nginx: nginx" for NGINX servers.

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

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

About the author


Passionate about everything that means gadget and IT, I am pleased to write on from 2006 and I love to discover new things about computers and macOS, Linux operating systems, Windows, iOS and Android.

Leave a Comment