You don’t have permission to access /php/php-cgi.exe/index.php on this server. PHP 5 on Apache 2.2

Did you get this on your fresh install of PHP5 on Windows?

Forbidden
You don’t have permission to access /php/php-cgi.exe/index.php on this server.

You might encounter this with a default installation of Apache 2.2 (I used the exe installer) and a manual install of PHP5 as cgi on Windows. I placed this in my httpd.conf and followed other steps according to the PHP5 on Apache 2.2 instructions by using in httpd.conf:

#load php5 as cgi
ScriptAlias /php/ “c:/php/”
AddType application/x-httpd-php .php
Action application/x-httpd-php “/php/php-cgi.exe”

In order to fix the forbidden error I had to change this line:

<Directory “C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/”>
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

to this:

<Directory “c:/php”>
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>