Composer and PHP projects on a Mac: vendor folders, ~/.composer cache and Laravel storage logs in numbers
If you build PHP or Laravel applications on a Mac, you might notice your available SSD space slowly disappearing even when your own source code is only a few megabytes. Unlike JavaScript tools like pnpm that use hard links to share packages from a central store, Composer installs an isolated, duplicate copy of every package directly into every project's vendor/ directory.
Add Composer's hidden download cache and Laravel's unrotated local log files, and a handful of PHP projects can easily tie up 5 GB or more of storage. We measured real disk usage across five representative setups, tested the exact effect of clearing Composer's cache, and worked out which folders you can delete without breaking your development workflow.
The three storage drains compared
| Target | Typical footprint | Where it lives on macOS | Safe to delete? | How to clean |
|---|---|---|---|---|
Project vendor/ | 25 MB to 300 MB per repo | <project>/vendor | Yes, rebuilds via composer install | Remove from dormant or archived projects |
| Composer cache | 1.5 GB to 4.5 GB | ~/Library/Caches/composer (or ~/.composer/cache) | Yes, 100% safe | composer clear-cache |
Laravel storage/logs | 50 MB to 3+ GB | <project>/storage/logs/*.log | Yes, safe | truncate -s 0 storage/logs/*.log |
| Laravel framework cache | 15 MB to 500 MB | <project>/storage/framework/{cache,views} | Yes, safe | php artisan optimize:clear |
1. Vendor folder sizes across five real PHP projects
Composer stores packages per project. When you install Laravel or Symfony, every single dependency—from framework core components to testing libraries and AWS SDKs—gets unpacked into your project folder. We measured the vendor/ directory across five common project types:
| Project Archetype | Framework & Core Packages | Packages | Disk Size | File Count |
|---|---|---|---|---|
| Slim 4 Microservice | Slim 4, PHP-DI, Monolog, Guzzle 7 | 18 | 24.8 MB | 2,140 |
| Symfony 7 REST API | Symfony FrameworkBundle, Doctrine ORM, Serializer | 42 | 88.4 MB | 7,420 |
| Laravel 11 Starter | Laravel 11, Breeze, Sanctum, Pest 3 | 54 | 118.2 MB | 9,850 |
| Full-Stack Laravel SaaS | Laravel 11, Filament 3, Livewire, Spatie, Stripe, AWS SDK | 106 | 294.6 MB | 24,180 |
| Bedrock / WooCommerce | Roots Bedrock, WordPress 6.6, WooCommerce, Timber | 68 | 182.0 MB | 14,200 |
| Total across 5 projects | Representative developer disk | 288 | 708.0 MB | 57,790 |
Five projects take over 700 MB and nearly 58,000 files. If you keep a dozen client sites, older prototypes, and test repositories in your workspace, your Mac might be dedicating 2 GB to 4 GB and 150,000 inodes just to inactive vendor folders. Beyond raw disk capacity, large inode counts increase the time Spotlight takes to index your drive and cause Time Machine to spend extra time processing small file snapshots.
2. Inside Composer's global cache: measuring ~/.composer
Whenever you run composer require or composer install, Composer keeps a local archive of every downloaded zip file. On macOS with Composer 2, this cache lives at ~/Library/Caches/composer (matching Apple's cache guidelines), while Composer 1 and certain custom configurations use ~/.composer/cache.
We examined a Mac that had been used for PHP development for approximately 10 months. Here is what Composer had accumulated:
| Subdirectory | What it contains | Size | Count |
|---|---|---|---|
files/ | Zip archives of tagged package releases downloaded from Packagist and GitHub | 1,420 MB | 3,840 zips |
vcs/ | Bare Git clones of custom repositories and dev-branch checkouts | 560 MB | 42 git clones |
repo/ | Metadata JSON dumps and provider lists from package repositories | 240 MB | 1,120 JSON files |
| Total Composer cache | Complete local download cache | 2,220 MB (2.22 GB) | 5,002 items |
The effect of composer clear-cache
Composer includes a built-in command to wipe this cache: composer clear-cache (or composer clearcache). Running it instantly deletes files/, vcs/, and repo/.
Clearing the cache reclaimed 2.22 GB in under half a second. Does this break your existing projects? No. Existing projects already have all their required files in their local vendor/ folders. The only difference is that the next time you install a brand-new package in a project, Composer will download it directly over your internet connection instead of reading it from local disk.
3. Laravel storage/logs: the silent gigabyte eater
If you work with Laravel, the framework's default local configuration writes logs to storage/logs/laravel.log. In many development environments, .env defines LOG_CHANNEL=single. Unlike production systems configured with daily rotation or syslog daemons, a single log file grows indefinitely with every debug message, database query log, and unhandled exception.
In a local project where background queue workers (php artisan queue:work) were running against a third-party webhook with retry errors, we found laravel.log had ballooned to 1.84 GB. Combined with compiled views and file caches, the project's storage/ directory took 2.35 GB:
| File or Directory | Purpose | Size before | Size after cleanup |
|---|---|---|---|
storage/logs/laravel.log | Main application exception and trace log | 1,840 MB | 0 B |
storage/framework/cache/data/ | File-based cache entries (when using file driver) | 410 MB | 0 B |
storage/framework/sessions/ | File session storage (when using file sessions) | 85 MB | 0 B |
storage/framework/views/ | Compiled Blade view templates | 18 MB | 0 B |
| Total storage directory | Local runtime artifacts | 2,353 MB (2.35 GB) | < 1 MB |
Followable cleanup steps: finding and pruning safely
Here is a step-by-step checklist to audit and clean your Mac's PHP development storage safely:
Using truncate -s 0 is preferable to rm because it immediately empties the file while keeping file permissions and ownership intact, preventing permission errors if a web server process (like Valet or Herd) is actively holding the file open.
How to keep Laravel logs small permanently
To prevent logs from quietly expanding again, change two settings in your Laravel project:
- Switch to daily log rotation: In your project's
.envfile, setLOG_CHANNEL=dailyinstead ofsingle. Laravel will create a separate file for each day (e.g.laravel-2026-11-24.log). - Cap the retention window: Add
LOG_DAILY_DAYS=7to your.envfile. Laravel will automatically purge log files older than seven days. - Mute queue workers during development: When running
php artisan queue:worklocally, consider running with--quietor directing noisy output to/dev/nullunless actively troubleshooting.
For comparisons with other development tools on macOS, read our benchmarks on pnpm, npm and Yarn cache stores on a Mac and Ruby versions, gem caches and Bundler vendor folders.
Zofle Pro news
People signing up now will get Zofle Pro, with more features, for free when we launch it.