Anyone who puts a site on a server eventually meets the numbers 644, 755 and 777. A plugin will not install or an image will not upload, and forum advice says "just set it to 777". That makes the symptom disappear but leaves the site seriously exposed. File permissions on Linux decide who can read, change and execute each file, so understanding them is a core part of website security.
Reading permission numbers
Every file and directory has separate permissions for the owner, the group and everyone else. Each gets read (4), write (2) and execute (1), and the sum gives one digit: 6 is read and write, 7 is everything, 5 is read and execute.
| Number | Symbolic | Meaning |
|---|---|---|
| 644 | rw-r--r-- | Owner reads and writes, others read |
| 755 | rwxr-xr-x | Owner does everything, others read and enter |
| 600 | rw------- | Only the owner reads and writes |
| 777 | rwxrwxrwx | Everyone can do everything |
For a directory, "x" means permission to enter it and reach files inside. That is why directories are usually 755 and files 644; without "x" on a directory the web server returns 403 even if the files themselves are fine.
Checking current permissions
ls -l ~/public_html
stat -c '%a %n' ~/public_html/*
In the ls -l output the first character shows the type (d for a directory, - for a regular file) and the next nine show permissions for owner, group and others, while stat prints the numeric form directly. The file manager in panels such as ISPmanager can also show and change permissions if you have no SSH access.
Why 777 is dangerous
777 lets any user or process on the server modify the file. If a plugin has a vulnerability, an attacker can drop a PHP file into a world-writable directory and run it from the browser, which is a classic way web shells get planted. Some hosting setups also refuse to run PHP scripts that are group- or world-writable and return a 500 error. On modern hosting PHP runs as the site owner, so 644 and 755 are enough for writing; if 777 seems necessary, the real problem is usually the wrong file owner.
Example: a hotel site in Bukhara
A small Bukhara hotel runs bookings on WordPress. Image uploads break, and the developer sets uploads to 777. Months later an old plugin is used to write a .php file there and the site starts sending spam. The original upload issue was ownership: files had been copied as another user. The right fix was 755/644, correct ownership, and blocking PHP in uploads on Apache:
<FilesMatch "\.(php|phtml|phar)$">
Require all denied
</FilesMatch>
Fixing permissions in bulk
Make sure you are in the right directory and have a backup first:
cd ~/public_html
find . -type d -exec chmod 755 {} +
find . -type f -exec chmod 644 {} +
chmod 600 wp-config.php
chmod 600 .env
Use 600 for config files when PHP runs as the site owner, or 640 with the correct group when the web server runs as a separate user. Check the site right after any change, and revisit permissions or ownership if you see 403 or 500. If you have questions on sayt.uz hosting, support is available through the cabinet.
Ownership on a VPS
Files copied as root stay owned by root, and the site cannot update them. Fix the owner instead of widening permissions:
sudo chown -R siteuser:siteuser /var/www/example.uz
Here siteuser is the account PHP-FPM or the web server uses for the site. Files should belong to the site user, and permissions should stay at the minimum the site needs. Widening permissions to work around an ownership problem only trades a small inconvenience for a real security hole.