PHP Windows#

Installation (24.12.2020)#

  1. Download latest version of x64, Thread Safe, Zip (php-8.0.0-Win32-vs16-x64.zip)
  2. Unzip somewhere
  3. add module to Apache at C:\Apache24\conf\httpd.conf
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

LoadModule php_module "G:/lang/Apache/php/php8apache2_4.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "G:/lang/Apache/php"

Check version via Apache#

Create C:\Apache24\htdocs\info.php
<?php phpinfo(); ?>
and open http://localhost/info.php

Execute Commands#

Generelly you embed PHP in web pages and execute it within the web server (mainly Apache).
The CLI SAPI enables execution directly.

command line, use G:\lang\Apache\php.exe

php -h    = help
php -i    = info
php -r "print_r(get_defined_constants());"
php -r "print(phpversion());"
Note: at Windows use double quote to wrap whole command and single quote for text inside