PhpStorm设置排除路径后仍上传对应文件夹问题求助
Hey there, sorry to hear you're having trouble with PhpStorm's Deployment excluded paths not sticking! Let's go through some common fixes that usually resolve this issue:
Double-check your excluded paths setup
First, make sure the paths you added use the right relative syntax. For example, if you want to exclude anode_modulesfolder at your project root, the path should benode_modules/(don't forget the trailing slash to specify it's a folder). Also, double-check that you added these exclusions to the correct deployment server in the Configure dialog—it's easy to accidentally edit the wrong server's settings without noticing.Add the folders to project-level exclusions
PhpStorm has a separate project exclusion setting that can reinforce deployment rules. Head toFile -> Project Structure -> Modules, select your module, then switch to theExcludedtab. Add the problematic folders here—this tells PhpStorm to treat them as non-project files, which should prevent them from being uploaded.Review your upload trigger settings
If you're using automatic uploads (Tools -> Deployment -> Automatic Upload), check the trigger type. If it's set toAlways, PhpStorm might upload files before the exclusion rules are fully applied. Try switching toOn explicit save actionand manually trigger an upload to test if the exclusions work then.Clear PhpStorm's cache
Cached data can sometimes cause PhpStorm to ignore new settings. To fix this:- Go to
File -> Invalidate Caches... - Check the box for
Clear file system cache and local history - Click
Invalidate and Restart
Once PhpStorm restarts, try deploying again to see if the excluded folders are skipped.
- Go to
Check for conflicting deployment rules
Take a look atTools -> Deployment -> Optionsto make sure there aren't any settings overriding your exclusions. For example, if you haveUpload changed files automatically to the default serverenabled alongside a custom sync rule, it might bypass your excluded paths.Test with a manual deployment
Instead of relying on automatic uploads, try a manual deploy: go toTools -> Deployment -> Upload to [Your Server Name]. When prompted, review the list of files/folders that will be uploaded—this lets you see exactly what's being included and whether your exclusions are actually being applied.
If none of these steps work, you could export your deployment config (Tools -> Deployment -> Configure -> Export) and check the XML file for any unexpected entries related to the excluded paths—sometimes there are hidden settings that don't show up in the UI.
内容的提问来源于stack exchange,提问作者user8040474

