XAMPP is one of the easiest options to develop using PHP or PHP CLI. I use CakePHP for development and one of the features of CakePHP is to back the MVC. In this guide, we’ll see how to get started. This tutorial doesn’t teach you how to use CakePHP’s bake feature. This guide is specifically written for Windows Vista or Windows 7.

0. Objective

To run XAMPP’s PHP CLI, you first have to set up the environment variables for PHP CLI. Also introduce how to get started on CakePHP’s console.

1. Setting up environment variables

Firstly, we would need to let the command prompt know where to find php.exe. In my computer set up, it is located in ‘C:xamppphp’. Yours might be in ‘C:xampp-litephp’ depending on where you install your XAMPP.

We need to edit some system environment variables:

Editing system environment variables in Windows Vista.

Click on ‘Edit the system environment variables’, a dialog box will pop up. Click on ‘Environment Variables…’, you should be greeted with the following dialog box:

Editing the path for environment variables

My path looks like this before I add anything:


Append your XAMPP PHP directory at the back of what is already there:


Open a new command prompt (don’t use existing one), and type “php” and see if there are any problems.

2. Avoiding MSVCR71.dll error

I encountered an error: “php.exe – System Error: The program can’t start because MSVCR71.dll is missing from your computer. Try reinstalling the program to fix this problem.“.

PHP MSVCR71 dll error

PHP MSVCR71 dll error

This error is caused by the “php_pgsql.dll” extension. We can proceed by disabling PostgreSQL if we don’t use it. If you do need it, you may consider installing Microsoft .NET Framework 1.1.

Open the file ‘php.ini’ in ‘C:xamppphp’ and search for “pgsql”. Disable the extension by placing a semicolon in the beginning of the line this way:

[code lang=“dos”];extension=php_pgsql.dll[/code]

3. Command Prompt’s “Start in” setting

You can have multiple shortcuts of command prompts in your desktop. I set my command prompt shortcut to start in ‘C:xampphtdocsdevapp’ which is my CakePHP application folder:

Command prompt properties start in setting

Command prompt properties start in setting

And when I run the command prompt, it will show:

[code lang=“dos”]Microsoft Windows [Version 6.1.7000]

Copyright © 2006 Microsoft Corporation. All rights reserved.


This is just more convenient without having to navigate through the folders again and again.


4. Running the CakePHP console

You should run the Cake console in your application folder this way:

[code lang=“dos”]C:xampphtdocsdevapp>“../cake/console/cake” bake[/code]

This runs the ‘cake’ program and tells it to bake.

For a list of CakePHP console commands to use, you can try:

[code lang=“dos”]C:xampphtdocsdevapp>“../cake/console/cake” help[/code]

That’s all

You can also put the CakePHP console path in your Windows environment variables. However note that if you have multiple projects with different versions, this method is less than ideal. Hope it helps.

comments powered by Disqus