This is a short step by step tutorial how to integrate git (source code management) and Composer (dependency management) in XAMPP without the need of any defined OS Path variables or registry keys (XAMPP philosophy).
tested environments
- xampp-win32-1.8.2-0-VC9.zip with PortableGit-1.8.3-preview20130601.7z
- xampp-win32-1.8.3-4-VC11.zip with PortableGit-1.9.4-preview20140611.7z
- xampp-win32-1.8.3-5-VC11.zip with PortableGit-1.9.4-preview20140929.7z
0. Requirements
- XAMPP for Windows as .zip or .7z version
- msysgit PortableGit
- Code Editor of your choice (e.g. Notepad++)
1. Installing XAMPP
- extract your downloaded XAMPP .zip file to the root of your harddisk, so that you will get a folder c:\xampp or d:\xampp or etc.
- open your \xampp\php\php.ini file in your favorite Editor and enable the php_openssl.dll module by removing the leading Semicolon from the line
- Code: Select all
;extension=php_openssl.dll
- start your XAMPP control panel by right clicking -> run as Administrator
- click the [Shell] Button and accept that the xampp_shell.bat file gets created and close the Shell window again
2. Installing git
- extract your PortableGit 7z file to \xampp\git
- open the \xampp\xampp_shell.bat file in your editor
- before the string %Path% add the following string
- Code: Select all
%~dp0git\bin;
- save the file and open the XAMPP Shell by clicking the [Shell] Button in your control panel
- execute the following command to test git
- Code: Select all
git --version
3. Installing Composer
- in your XAMPP Shell navigate to your \xampp\php\ path
- execute the command
- Code: Select all
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
- in \xampp\php\ create a new file composer.bat with the contents
- Code: Select all
@php "%~dp0composer.phar" %*
- to test composer type in XAMPP shell
- Code: Select all
composer --version
best wishes,
Altrea