October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Fix WordPress File Permissions After Moving Vhost Directories

WordPress permission errors after a vhost move often come from a stale document root or the wrong PHP account—not just chmod values. Verify the path first, then apply least-privilege ownership and writable content paths.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fix a WordPress site that moved to a new vhost directory by checking two separate layers: first, make sure the active Apache or Nginx virtual host and PHP handler use the new document root; second, give the account that actually runs PHP read and traversal access to the tree, with write access only to directories WordPress must modify. A filesystem move alone proves neither condition.

Why a moved site can load but fail to install plugins or upload media

WordPress can display pages while administrative writes fail because reading and writing are separate operations. The web server may still be serving an old directory, or PHP may be executing with an account that cannot traverse the new path. Existing PHP files and media can therefore load even though an upload, plugin installation, theme update or automatic update returns a permissions error.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Unix permissions also apply to every parent directory. The PHP account needs execute (traverse) permission on each directory from the filesystem root to the WordPress directory, read permission for files it must load, and write permission only on paths that WordPress is expected to change. The correct owner and group vary by host; www-data is common on some Linux distributions but is not universal.

Safe repair workflow

  1. Back up the WordPress directory, uploads and other site files, plugins, and the database before changing ownership, modes or server configuration.
  2. Verify the active virtual-host configuration and PHP path mapping.
  3. Identify the account that actually runs PHP or the web server.
  4. Inspect every parent directory, the moved document root, wp-content, uploads and any ACL or mandatory-access-control rules.
  5. Apply a least-privilege ownership and mode scheme.
  6. Grant narrowly scoped write access to required WordPress paths.
  7. Handle .htaccess only when an Apache workflow needs WordPress to edit it.
  8. Review WordPress mode constants, test normal operations and remove temporary migration settings.

1. Back up before touching permissions

Create a restorable copy before running recursive chown or chmod commands. WordPress’s migration guidance calls for backups of the WordPress directory, images and uploads, plugins and other files, plus the database. Keep the backup outside the directory being repaired and verify that it can be read.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

A permissions change can make both the web process and your deployment account unable to work. A backup lets you reverse an ownership mistake, restore a missing configuration file or recover from an accidental recursive command.

2. Confirm that the active vhost uses the new directory

Do this before changing modes. A stale path can imitate a permissions problem because Apache, Nginx or PHP-FPM may still reference the old tree.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Apache checks

Inspect the enabled virtual host and confirm that its DocumentRoot points to the moved directory. Also check any PHP-FPM proxy or handler definition for a stale socket or path. On systems that provide it, the virtual-host listing command can show which configuration is active:

apachectl -S

Then inspect the enabled site configuration for the new root and PHP handler. The exact enabled-sites location differs by distribution, so use the path reported by your host’s Apache configuration.

Nginx checks

Confirm the active server block’s root directive and its PHP location block. The fastcgi_pass socket or upstream must be the intended PHP-FPM pool, and fastcgi_param SCRIPT_FILENAME must resolve to the new root rather than the old one. A typical diagnostic is:

nginx -T

Review the rendered configuration, not only an unenabled file in a sites-available directory. Nginx does not use .htaccess for rewrites; rewrite rules belong in the server configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the effective document root from the application

Compare the configured root with the directory containing the WordPress files that are actually being served. If the front end shows an old theme, old media or an old plugin version, stop and correct the vhost or PHP path mapping before changing permissions.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

3. Identify the account that runs PHP

Do not assume the service account is www-data. Depending on the host, PHP-FPM can run as a per-site user, Apache can use a different account, and containers can map a numeric user ID that has no familiar name on the host.

Inspect the running processes and the PHP-FPM pool configuration. A process listing can provide a lead:

ps -eo user,group,comm | grep -E 'php-fpm|apache2|httpd|nginx'

Confirm the result against the pool’s user and group settings or the hosting provider’s documented execution model. The account that serves static files is not always the account that executes PHP. On managed hosting, ask the provider which user and group should own code and which paths are supported for WordPress writes before changing server configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Inspect the complete path, not just the WordPress files

Use a path inspection tool to display permissions on every component:

namei -l /var/www/example.com/public

Replace the example path with the actual document root. Every parent directory needs execute permission for the relevant user or group. A directory mode that looks correct at the final level cannot compensate for a parent directory that blocks traversal.

Inspect the moved tree and its important subdirectories:

stat -c '%A %U:%G %n' /var/www/example.com/public /var/www/example.com/public/wp-content /var/www/example.com/public/wp-content/uploads

Also check for access-control lists when ordinary owner, group and other bits look correct:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
getfacl -p /var/www/example.com/public/wp-content/uploads

On hosts using SELinux, AppArmor or another isolation layer, a Unix-mode change may not be sufficient. Check the host’s policy and audit logs rather than disabling the security control as a shortcut.

5. Apply a least-privilege baseline

WordPress hardening guidance describes directory mode 755 as a typical baseline and generally limits regular files to 644. Those values allow the site account to maintain the code while the PHP process can read and traverse it. They are a starting point, not a universal rule: the owner, group and required write paths depend on the execution model.

Choose ownership before running recursive commands

A safer arrangement for many single-site Linux deployments is:

  • A site-maintainer or deployment account owns the code.
  • The PHP/web-server account can read and traverse the code.
  • Only WordPress-writable directories receive write access for the PHP account.
  • Administrators use SFTP, SSH or a documented deployment process instead of making the entire tree writable.

If the actual maintainer is siteadmin and the verified PHP group is phpgroup, a pattern such as this may be appropriate:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
chown -R siteadmin:phpgroup /var/www/example.com/public
find /var/www/example.com/public -type d -exec chmod 755 {} ;
find /var/www/example.com/public -type f -exec chmod 644 {} ;

Those account and path names are examples. Substitute the accounts confirmed on this server; never copy a distribution-specific ownership command blindly. A recursive ownership change can remove a deployment user’s access or give the web process control of code that should remain administrator-owned.

Give WordPress write access only where it needs it

Media uploads normally belong under wp-content/uploads. Plugin and theme installation or automatic updates may require WordPress to write in parts of wp-content, depending on the site’s update method and filesystem credentials. Prefer group permissions or an ACL over making the whole document root writable.

For a verified shared group, one possible pattern is:

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
chgrp -R phpgroup /var/www/example.com/public/wp-content/uploads
find /var/www/example.com/public/wp-content/uploads -type d -exec chmod 775 {} ;
find /var/www/example.com/public/wp-content/uploads -type f -exec chmod 664 {} ;

Use this only when the PHP account is genuinely a member of phpgroup and the site’s security policy permits group writes. An ACL can grant the PHP account access without changing the primary owner:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
setfacl -R -m u:phpuser:rwX /var/www/example.com/public/wp-content/uploads
setfacl -R -d -m u:phpuser:rwX /var/www/example.com/public/wp-content/uploads

Replace phpuser with the verified account and confirm that ACLs are supported and preserved by the host. If the provider supplies a repair tool or a prescribed ownership scheme, use that instead of inventing one.

Why chmod 777 is not a fix

Mode 777 gives every local user and the web process read, write and execute access. WordPress warns that world-writable files increase the damage a compromised web process or another local account can cause. It can make a symptom disappear while hiding the real owner, group, vhost or security-policy error. Treat it as an insecure diagnostic shortcut, not a durable repair; revert it and implement the narrowest permissions that pass the required test.

6. Handle .htaccess only for Apache

Apache installations using WordPress’s permalink rules may need WordPress to create or update .htaccess. Grant write access to that file only when the Apache configuration and the site’s normal workflow require it. Keep the rest of the code non-writable by PHP where possible.

Nginx does not read .htaccess. If an Nginx site has rewrite or front-controller problems after the move, correct the server block instead of changing the mode of an unused file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

7. Review WordPress’s file-mode settings

FS_CHMOD_DIR and FS_CHMOD_FILE in wp-config.php can override the defaults WordPress uses for newly created directories and files. If new uploads or plugin files consistently receive unexpected modes, inspect these constants and compare them with the host’s required policy.

Change them only with a specific reason. A constant cannot grant access that the filesystem denies, and it cannot repair a stale vhost path or a missing parent-directory execute bit.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

8. Test the repair in the order users experience it

  1. Load the public front end and confirm that it is serving the moved installation, not a cached or old tree.
  2. Open /wp-admin and check for PHP or filesystem errors.
  3. Upload one small test image, then verify that the file appears in the expected year/month uploads directory and can be served.
  4. Perform a controlled plugin or theme update if that operation is part of the site’s normal workflow. Use a maintenance window and a backup.
  5. Review the Apache, Nginx and PHP-FPM error logs if any step fails. The exact log location is host-dependent.
  6. Check the site’s WordPress and home URLs after the move, including HTTPS and any changed path or domain.
  7. Remove temporary migration settings and credentials used during the move.

WordPress specifically warns that leaving the RELOCATE constant in wp-config.php is insecure. If it was added during migration, remove it after the correct URLs are saved and the site works.

Choose the repair method for the server’s execution model

Execution model Typical code owner Where PHP writes Preferred adjustment Main caution
Shared hosting Provider-defined account Provider-defined content paths Use the host’s file manager, repair utility or support instructions Do not assume service names or change server configuration you do not control
Per-site PHP-FPM pool Deployment or site-maintainer user Usually wp-content paths required by the site’s update workflow Verified group permissions or ACLs for those paths Confirm the pool’s actual user and group before chown
Single system user running both deployment and PHP The same site user As required by WordPress Keep directories and files at least privilege; avoid broad world write A compromised PHP process may have control of all code owned by that user
Containerized deployment Host or container numeric UID/GID Mounted volume paths Align UID/GID and mount permissions with the container image and deployment process A name such as www-data on the host may not represent the container user
Security-controlled host Host-specific Mode bits plus ACL or policy labels Use documented ACL, SELinux, AppArmor or isolation rules Do not disable mandatory controls to mask an ownership problem

Troubleshoot by symptom

The site shows an old version after the move

Check the active Apache DocumentRoot or Nginx root, PHP-FPM’s SCRIPT_FILENAME mapping and caches. This is primarily a path-selection problem, not a permission problem.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The front end works but uploads fail

Verify the PHP account, parent-directory traversal and write access to wp-content/uploads. Inspect ACLs and host security logs if the owner/group and mode bits appear correct.

Plugin installation asks for FTP credentials

WordPress cannot write through its preferred filesystem method. Confirm that the PHP account has the intended access to the relevant wp-content paths and that FS_CHMOD_DIR or FS_CHMOD_FILE is not producing unusable modes. Do not solve this by making the whole tree 777.

New files have the wrong permissions

Review the two FS_CHMOD_* constants, the process umask and any default ACL on the destination directory. Correct the source of the mode rather than repeatedly changing individual files.

Apache permalinks fail after the move

Check whether Apache can read the intended .htaccess and whether the directory allows traversal. If WordPress must update the file, grant only the required write access. For Nginx, configure rewrites in the server block instead.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Changing Unix modes has no effect

Recheck the active vhost and PHP-FPM pool, then inspect ACLs and SELinux, AppArmor or hosting-isolation rules. A stale path or mandatory policy can override an apparently correct mode-bit repair.

When to stop and contact the host

Managed-hosting customers should use provider documentation or support when they cannot identify the PHP account, do not control the vhost, or are unsure how the provider implements isolation. WordPress notes that permission requirements differ from host to host. Ask the provider for the supported document root, PHP-FPM user/group, writable WordPress paths and any required ACL or security-label procedure.

Escalate rather than guessing if a recursive ownership command would affect multiple sites, if the directory is a shared mount, if the server uses containers, or if changing permissions could violate the provider’s security model.

Final security checklist

  • The active vhost and PHP path mapping reference the new directory.
  • The verified PHP account can traverse parent directories and read the WordPress code.
  • Directories use a host-approved baseline such as 755 and files such as 644, with documented exceptions.
  • Only required content paths are writable by PHP.
  • No production path relies on chmod 777.
  • Apache-only .htaccess write access is limited and Nginx rewrites are configured in Nginx.
  • FS_CHMOD_DIR and FS_CHMOD_FILE match the intended policy.
  • Uploads and a controlled update have been tested, logs reviewed and URLs confirmed.
  • The insecure RELOCATE constant and other temporary migration settings have been removed.
  • A verified backup exists before and after the repair.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.