Monorepos and Enterprise Projects
A PhpStorm that struggles through hundreds of modules with default configuration is not a productivity tool. Indexing excludes, heap configuration, sensible scopes, and inspection profiles tuned to the project type make the difference between an IDE that helps and one that slows you down.
Table of Contents
- 1. The problem with large projects in PhpStorm
- 2. Indexing excludes: what PhpStorm should not analyze
- 3. Heap and JVM settings for large codebases
- 4. Scopes: limiting search and inspections to relevant areas
- 5. Configuring inspection profiles for enterprise projects
- 6. Settings Sync and team consistency
- 7. Monorepo-specific configuration
- 8. Using plugins sensibly in large projects
- 9. Comparison: default configuration vs. enterprise configuration
- 10. Summary
- 11. FAQ
1. The problem with large projects in PhpStorm
Opening PhpStorm with default configuration on a Magento project with 300 modules leads to a well known result: the IDE indexes for hours, the laptop fan runs at full speed, autocompletion becomes sluggish, and inspections flag thousands of warnings in vendor/ code that nobody wants to change. This is not a bug in PhpStorm, it is a consequence of default settings that are fine for small projects but need to be adjusted for enterprise setups.
The core problem is indexing: by default, PhpStorm analyzes everything located inside the project directory. For Magento that means vendor/ with thousands of PHP files, generated/ with automatically generated code, pub/static/ with compiled assets, and var/ with runtime data. These directories do not need full IDE analysis, they need to be in the autocompletion index but should not be treated as editable source files. The difference between "excluded" and "library root" is decisive here.
A second problem affects monorepos with several independent applications: PhpStorm has a single project concept and treats the entire directory as one PHP application. In a monorepo with a Magento backend, a Node.js frontend, and a Python script folder, this can lead to inconsistent autocompletion and confusing error display. This is where scopes and content root configurations help.
2. Indexing excludes: what PhpStorm should not analyze
Indexing excludes are the most important performance measure for large PHP projects in PhpStorm. There are two categories: directories that should be completely removed from analysis (Excluded), and directories that should be treated as a library (in the index for autocompletion, but no inspections). For Magento, the following split is recommended:
Excluded: pub/static/, var/, dev/, .git/, node module directories. These directories do not contain PHP classes needed for autocompletion. Library Root: vendor/, generated/. PhpStorm needs these for autocompletion but should not show inspections or warnings inside them. Configuration happens in the Project Structure settings (Settings → Project → Project Structure) or through the .idea/ configuration files.
# .idea/Mironsoft.iml - Project Structure configuration
# (automatically managed by PhpStorm, shown here for documentation)
# Mark directories as EXCLUDED (no index, no inspections):
# - src/pub/static (compiled assets)
# - src/var (cache, logs, sessions)
# - src/dev (dev tools, not source files)
# Mark directories as SOURCE ROOT:
# - src/app/code (own code, full analysis)
# - src/app/design (templates, full analysis)
# Mark directories as LIBRARY ROOT:
# - src/vendor (autocompletion, no inspections)
# - src/generated (autocompletion for DI proxies)
# PhpStorm .gitignore recommendation for .idea/:
# .idea/workspace.xml (personal settings, do not commit)
# .idea/shelf/ (temporary changes, do not commit)
# .idea/*.iml (project specific, commit!)
# .idea/runConfigurations/ (run configs, commit!)
A common source of performance problems: PhpStorm fully indexes vendor/ as source files. In a Magento project with a 500 MB vendor/ folder and thousands of PHP classes, this index build takes a long time and consumes a lot of heap. The solution is to mark vendor/ as "Library Root" instead of as source files. You then get autocompletion, but no inspections and no unnecessary index overhead.
3. Heap and JVM settings for large codebases
PhpStorm runs on the JVM and has a default heap of 2 GB. For enterprise projects with Magento and many modules, that is often too little. Symptoms: PhpStorm becomes sluggish after several hours of work, garbage collection pauses become noticeable, and the indexing process takes a very long time. The solution: increase the heap under Help → Change Memory Settings to 4 GB or more. With 16 GB of RAM, 4 to 6 GB for PhpStorm is a sensible choice.
Additional JVM options can be configured in the phpstorm64.vmoptions file, opened via Help → Edit Custom VM Options. Important settings for large projects: -Xms2g (initial heap size, reduces warm-up time), the GC algorithm (-XX:+UseG1GC is the default and works well for IDE workloads), and the file system notifier limit on Linux (the inotify limit needs to be raised).
# phpstorm64.vmoptions - optimized for enterprise projects
# Open via: Help → Edit Custom VM Options
# Heap: at least 4GB for Magento monorepos
-Xms2g
-Xmx6g
# G1 garbage collector, default since JVM 9, good for IDE workloads
-XX:+UseG1GC
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:ReservedCodeCacheSize=512m
-XX:+HeapDumpOnOutOfMemoryError
# File system performance on Linux
# Prerequisite: sudo sysctl fs.inotify.max_user_watches=524288
# Persistent: echo "fs.inotify.max_user_watches=524288" | sudo tee /etc/sysctl.d/99-phpstorm.conf
# Startup optimization
-XX:CICompilerCount=2
-XX:+TieredCompilation
# IDE performance
-Dsun.io.useCanonCaches=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djdk.attach.allowAttachSelf=true
# Suppress verify errors on certain JVM versions
-XX:-OmitStackTraceInFastThrow
On Linux, there is a common pitfall: the operating system's inotify limit. PhpStorm watches file changes via inotify and needs a watch for every directory. Large projects quickly exceed the default limit of 8192 watches. The symptom: PhpStorm reports "External file changes sync may be slow" and does not reliably pick up changed files. The solution: sudo sysctl fs.inotify.max_user_watches=524288, made persistent in /etc/sysctl.d/.
4. Scopes: limiting search and inspections to relevant areas
Scopes in PhpStorm define file groups used for specific operations. With scopes you can limit IDE-wide search (Find in Files), inspections, and code analysis to the directories relevant to the current task. In a Magento monorepo with your own code under app/code/Mironsoft/ and template files under app/design/, you would define a scope called "Mironsoft Code" that contains only these paths.
Scope definitions are simple pattern expressions: file:src/app/code/Mironsoft//* for all files under the Mironsoft namespace. Scopes are created under Settings → Scopes and can then be used for inspections (Code → Inspect Code → Custom Scope), for search (the scope dropdown in Find in Files), and for refactoring operations. This way, an inspection only runs on your own code, not on thousands of vendor files.
5. Configuring inspection profiles for enterprise projects
PhpStorm's default inspection profile quickly shows hundreds of warnings on large PHP projects, many of which are not relevant or cannot be fixed in libraries. The solution is a project-specific inspection profile, created under Settings → Editor → Inspections and restricted to a scope. A sensible profile for Magento projects includes: all PHP type and logic inspections enabled for the app/code/ scope, PHPCS inspections only for your own code, and disabled duplication and dead code warnings for libraries.
Inspection profiles can be exported as XML and committed to the repository. This ensures that every developer on the team sees the same warnings and classifies the same issues as relevant. In .idea/inspectionProfiles/, the profile is stored as an XML file that belongs in the Git repository along with the other .idea/ configuration.
6. Settings Sync and team consistency
In enterprise teams with multiple developers, the consistency of PhpStorm settings is a real problem. Every developer has slightly different settings, which leads to different behavior for inspections, code style, and refactoring. PhpStorm offers two ways to achieve team consistency: Settings Sync via a JetBrains account (syncs personal settings) and checking .idea/ files into the repository (syncs project-specific settings).
For enterprise projects, a clear split is recommended: personal settings (keymap, UI preferences, themes) via Settings Sync per developer. Project-specific settings (code style, inspection profiles, run configurations, scopes) via .idea/ files in the repository. A .gitignore inside .idea/ defines which files are shared and which stay local.
# .idea/.gitignore - what to commit, what not to
# DO NOT commit (personal / local paths):
workspace.xml
tasks.xml
dictionaries/
shelf/
*.iws
httpRequests/
# COMMIT (team relevant):
# - inspectionProfiles/*.xml
# - runConfigurations/*.xml
# - codeStyles/
# - scopes/
# - *.iml
# - modules.xml
# - vcs.xml
# - sqldialects.xml
# Example: code style XML for PHP
# .idea/codeStyles/Project.xml
# → PSR-12 baseline with project specifics
# → Automatically loaded by PhpStorm
# → Ctrl+Alt+L formatting uses these settings
# Example: shared run configuration
# .idea/runConfigurations/Deploy_Dev.xml
# → Shell script: bin/deploy-dev
# → All developers share the same deploy task
7. Monorepo-specific configuration
Monorepos with multiple applications in one repository require special PhpStorm configuration. PhpStorm has no native "monorepo concept", but you can simulate one with multiple content roots: each sub-project can be added as its own content root (Settings → Project → Project Structure → Add Content Root). This gives each sub-project its own source root and its own exclude rules.
In a monorepo with backend/ (Magento), frontend/ (Node.js), and shared/ (common configuration), the sensible setup would be: backend/src/app/code as a PHP source root, backend/src/vendor as a library root, frontend/ as a JavaScript content root with its own settings, and shared/ as a plain folder with no special role. PhpStorm then treats PHP autocomplete and JavaScript autocomplete context-sensitively in their respective areas.
8. Using plugins sensibly in large projects
Every enabled plugin increases memory usage and lengthens IDE startup. In enterprise projects, the plugin list should be consistently trimmed down to what is actually needed. Disable unneeded plugins under Settings → Plugins. PhpStorm ships with many preinstalled plugins, many of which are not needed in a pure PHP backend project: Spring, Go, Kubernetes, Angular, Vue, and so on can be disabled if the project does not use them.
Recommended plugins for Magento enterprise projects: Magento PhpStorm (official JetBrains support for Magento di.xml and layout.xml), .env Files Support, PHP Annotations, Database Tools (native in Ultimate). Plugins to avoid in large projects: generic "productivity" plugins that scan many files, AI plugins that make an API call on every keystroke when no stable connection is available, and multiple Git plugins that duplicate the same functionality.
9. Comparison: default configuration vs. enterprise configuration
The difference between a default and an enterprise configuration of PhpStorm is substantial in practice. The table below shows the most important points and what actually changes.
| Area | Default configuration | Enterprise configuration | Impact |
|---|---|---|---|
| Heap | 2 GB | 4 to 6 GB | No GC pauses, smooth analysis |
| vendor/ handling | Source + inspections | Library Root | No warnings in vendor/, faster indexing |
| Inspections | Across the entire project | Scope: own code only | Only relevant warnings visible |
| Settings sharing | No strategy | .idea/ in the repo + Settings Sync | Consistent settings across the team |
| Plugins | All preinstalled ones active | Project relevant only | Faster startup, lower memory usage |
The configuration work for an enterprise PhpStorm setup is a one-time effort, but it pays off every day. A team of ten developers losing 30 minutes a day to slow IDE performance adds up to 5 hours per day of wasted development time. The time invested in a good enterprise configuration pays for itself within the first week.
10. Summary
Configuring PhpStorm for large monorepos and enterprise projects means consistently adjusting the default settings: indexing excludes stop PhpStorm from analyzing unnecessary directories. Raising the heap to 4 to 6 GB avoids GC pauses on large projects. Scopes limit inspections and search to your own code. Inspection profiles show only relevant warnings. Settings sharing via .idea/ files ensures team consistency. Reducing plugins improves startup performance and memory usage.
For Magento projects, the single most important measure is correctly classifying vendor/ as Library Root and pub/static/ as well as var/ as Excluded. These two changes alone significantly reduce indexing time and memory usage. Combined with a scope restricted to the Mironsoft code and a project-specific inspection profile, PhpStorm works like a productivity tool again, not like a resource hog.
PhpStorm Enterprise: The essentials at a glance
Indexing
vendor/ as Library Root, pub/static/ and var/ as Excluded. Settings → Project → Project Structure for configuration.
Heap
Help → Change Memory Settings: 4 to 6 GB. phpstorm64.vmoptions for additional JVM options. Raise the inotify limit on Linux.
Scopes
Settings → Scopes: create a Mironsoft code scope. Limit inspections and search to your own code. Commit team scopes to .idea/scopes/.
Settings Sync
Commit .idea/ to the repository (except workspace.xml). Code style, run configs, inspection profiles, and scopes shared. Personal settings via JetBrains Settings Sync.
Mironsoft
Enterprise PHP development, IDE configuration, and team setup
Want PhpStorm configured optimally for the whole team?
We analyze your PhpStorm setup, identify performance bottlenecks, and set up a consistent enterprise configuration, with documented settings that every developer can adopt.
Performance audit
Analyze and optimize indexing, heap, plugins, and excludes for your project stack
Team configuration
Set up consistent settings via .idea/: code style, inspections, scopes, run configs
Documentation
Setup documentation that fully onboards new developers in under 30 minutes
11. FAQ: PhpStorm Settings for Enterprise Projects
1How do I increase the heap in PhpStorm?
2Excluded vs. Library Root?
vendor/: Library Root. pub/static/, var/: Excluded.3Create a scope in PhpStorm?
file:src/app/code/Mironsoft//*. Usable in inspections and Find in Files.4Which .idea/ files to commit?
5Why is PhpStorm so slow with Magento?
6Restrict inspections to your own code?
7Fix the inotify limit warning?
sudo sysctl fs.inotify.max_user_watches=524288. Persistent: echo 'fs.inotify.max_user_watches=524288' | sudo tee /etc/sysctl.d/99-phpstorm.conf.