This article explains in detail how to configure the development environment to install and configure
PHP and the required libraries, to run
Grav CMS under
Windows operative system.
It's quite easy to install
Windows, leveraging the internal web server provided since the 5.4 release. The very first thing to do is to download the latest release of PHP. You might be confused about the right version to grab, so be sure to get the
VC11 x86 Non Thread Safe version.
Be sure to avoid downloading the
PHPsources, because they must be compiled to work.
Next, open the downloaded file and unpack it under a path where your user can read and write. Let's supposing you will unzip it under
PHP configuration comes with all the extensions disabled, so you must enable those required by
c:\php and copy the
php.ini-development into the same folder, then rename it
php.ini. When you are done, open it.
We are using the
developmentfile, because this file is already configured to run a development environment, which means you will be noticed when any error occurs.
Next, open the
php.ini and look inside it for the string
extension=php_curl.dll. You would notice it is prefixed by a semi-colon.
PHP recognizes that string as a comment and ignores it.
You just need to remove that semi-colon to activate that extension, but you need to change it as follows:
because it is stored under the
c:\php\ext. Now you just need to repeat that configuration for the following extensions:
extension=ext/php_intl.dll extension=ext/php_gd2.dll extension=ext/php_mbstring.dll extension=ext/php_xsl.dll
To check the installation just run from a Windows terminal the following command:
If you get an answer like this one:
PHP 5.6.10 (cli) (built: Jun 10 2015 15:59:37) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
it means your environment is ready to use
This configuration works but every time you need to run
PHP you have to refer to its full path, so
That could become annoying in the long time, so you can configure a Windows environment variable to run the
php command from every folder.
You can add a variable as follows, on a Windows7 system:
Start. Next, right click on
Propertiesfrom the contextual menu to open the
Advanced System Settings, then click on
System variablessection, look for the
Pathentry, click on it then click on the
Variable valuestring, then add the
;c:\php\string, which corresponds to the
PHPfolder, where the executable lives. Do not miss the semi-colon to separate this new path from others.
Windowsto apply that change.
Now, just download Grav, unzip the package everywhere in your computer where your uses can read and write, then enter that folder:
then run then the
PHP internal web server:
php -S localhost:8080
Now open your favorite browser and point it to:
and you can start playing with
At last, if you need to run the
Grav gpm system, just run it from your Grav installation path: