Permission Error on php-cgi.exe

This section describes the error of 'You don't have permission to access /cgi-bin-php/php-cgi.exe/hello.php on this server.' It is caused by the syntax change in the PHP directory access permission configuration settings.

Note that Apache Web server configuration setting has changed the directory access control syntax between 2.2 and 2.4.

If you are still using the old syntax on the PHP directory:

<Directory "/local/php/">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

You will see the following error in the Web browser:

Forbidden
You don't have permission to access 
   /cgi-bin-php/php-cgi.exe/hello.php on this server.

You must use the new syntax to grant access permission to the PHP directory:

<Directory "/local/php/">
   AllowOverride None
   Options None
   Require all granted
</Directory>

Last update: 2019.

Table of Contents

 About This Book

 PHP Installation on Windows Systems

Integrating PHP with Apache Web Server

 Downloading Apache 2.4.37 Binary for Windows

 Installing Apache 2.4.37 on Windows Systems

 Publishing HTML Documents as Web Pages

 Configuring Apache for PHP CGI Scripts

 Publishing PHP Scripts as Web Pages

Permission Error on php-cgi.exe

 charset="*" - Encodings on Chinese Web Pages

 Chinese Characters in PHP String Literals

 Multibyte String Functions in UTF-8 Encoding

 Input Text Data from Web Forms

 Input Chinese Text Data from Web Forms

 MySQL - Installation on Windows

 MySQL - Connecting PHP to Database

 MySQL - Character Set and Encoding

 MySQL - Sending Non-ASCII Text to MySQL

 Retrieving Chinese Text from Database to Web Pages

 Input Chinese Text Data to MySQL Database

 Archived Tutorials

 References

 Full Version in PDF/EPUB