Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

brandonviles's avatar

Deployment Scripts

Hello!

Two short questions:

Does "composer install" configure autoloading?

If not, is there anything wrong with adding "composer dump-autoload - o" to deploy script?

Also, someone in Freenode#composer said I could do "composer install -o". Not sure what that is about

0 likes
3 replies
brandonviles's avatar
brandonviles
OP
Best Answer
Level 2

Ok, just did:

$ composer install -o

Returned:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating optimized autoload files
Generating optimized class loader

Guess I answered my own question.

zefman's avatar

You might also want to add "php artisan optimize" :)

1 like
brandonviles's avatar

Ok, thanks for that tidbit! Currently I have no classes in /app/config/compile.php, I am using psr-4 in composer.json. Definitely something I will look into soon though!

Please or to participate in this conversation.