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 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:, 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 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 like to test and write tutorials about operating systems macOS, Linux, Windows, about WordPress, WooCommerce and LEMP web server configuration (Linux, NGINX, MySQL and PHP). I write on since 2006, and a few years later I started writing on iHowTo.Tips tutorials and news about devices in the ecosystem Apple: iPhone, iPad, Apple Watch, HomePod, iMac, MacBook, AirPods and accessories.

Leave a Comment