Install PHP and PEAR on Windows

Download PHP from windows.php.net (Download). Download the thread safe version to use with apache.

Decompress the zip file to your desired directory.  I used c:\dev\php-x.x.x\

Install PEAR ( Pear’s instrunctions ):

  • Download go-pear.phar (reference link)into the folder you decompressed php.
  • Open the command prompt with Adminstrator access.  You can do this by opening the start menu typing “cmd”, right click on the cmd.exe icon and select “Run as administrator”.  OR you can click the start menu, enter “cmd”, and then hit ctrl+shift+enter.
  • Change to the directory you decompressed php.
    cd c:\dev\php-5.4.5
  • In the php directory, copy php.ini-development or php.ini-production to php.ini.
    copy php.ini-development php.ini
  • At the command prompt type:
    php go-pear.phar
  • You will then be prompted to configure the installation.  Use default settings or customize to your hearts content.
  • If you copied the php.ini file you should be prompted to add the pear directory to the php.ini configuration.  Do this.
  • Add the PEAR_ENV.reg file to your registry:
    regedit PEAR_ENV.reg
  • Add the pear directory to your path:
    • Click the start menu, right click on “Computer” and select “Properties”
    • Click “Advanced system settings” located on the left pane.
    • On the “Advanced” tab under the System Properties window select “Environment Variables…”
    • Under “System variables” select the “PATH” variable and click on the “Edit…” button.
    • In the “Variable value:” text box, append to the end “;c:\dev\php-5.4.5”
    • Click “OK”