Skip to content

Using Composer with Wampoon

Wampoon includes a fully portable version of Composer that works without global installation. Since Wampoon is portable, it provides batch scripts that configure the PHP path before running Composer.

Wampoon provides batch scripts that configure the PHP path before running Composer:

ScriptLocationDescription
composer.bathtdocs/Convenient script for managing projects in htdocs
composer.batRoot folderRuns Composer with the correct PHP path
php.batRoot folderRuns PHP with the correct environment

To use Composer, open a command prompt and navigate to the htdocs folder, then run commands using composer.bat:

Terminal window
cd C:\Wampoon\htdocs
composer.bat install
batch

Or use the full path from any location:

Terminal window
C:\Wampoon\htdocs\composer.bat --working-dir=C:\Wampoon\htdocs\my-project install
batch

If you have multiple projects in htdocs, navigate to your project directory first:

Terminal window
cd C:\Wampoon\htdocs\my-project
:: Install dependencies from composer.json
composer.bat install
:: Add a package
composer.bat require vendor/package
:: Update all packages
composer.bat update
batch

Use the composer create-project command to scaffold new applications directly in your htdocs folder.

Open a command prompt in htdocs and run:

Terminal window
cd C:\Wampoon\htdocs
composer.bat create-project laravel/laravel my-laravel-app
batch
Terminal window
:: Laravel
composer.bat create-project laravel/laravel my-app
:: Symfony
composer.bat create-project symfony/skeleton my-app
:: Slim Framework
composer.bat create-project slim/slim-skeleton my-app
:: CakePHP
composer.bat create-project cakephp/app my-app
batch

After creating a project, access it at http://localhost/my-app (or the appropriate entry point for your framework).

If you need to run PHP scripts directly, use php.bat from the root folder:

Terminal window
C:\Wampoon\php.bat -v
C:\Wampoon\php.bat script.php
batch

If you frequently use Composer from the command line, you can add the Wampoon folder to your PATH environment variable for the current session:

Terminal window
set PATH=C:\Wampoon;%PATH%
batch

Then you can run commands directly:

Terminal window
composer.bat install
php.bat -v
batch