< Back

Install-Php

Sat Jan 18, 2020 6:48 pm

NAME Install-Php



SYNOPSIS

Installs PHP.





SYNTAX

Install-Php [-Version] <String> [-Architecture] <String> [-ThreadSafe] <Boolean> [-Path] <String> [[-TimeZone]

<String>] [[-AddToPath] <String>] [[-InitialPhpIni] <String>] [-InstallVC] [-Force] [<CommonParameters>]





DESCRIPTION

Download and installs a version of PHP.





PARAMETERS

-Version <String>

Specify the PHP version to be installed.

You can use the following syntaxes:

- '7' will install the latest '7' version (for example: 7.2.4)

- '7.1' will install the latest '7.1' version (for example: 7.1.16)

- '7.1.15' will install the exact '7.1.15' version

- '7RC' will install the latest release candidate for PHP 7

- '7.1RC' will install the latest release candidate for PHP 7.1

- '7.1.17RC' will install the latest release candidate for PHP 7.1.17

- '7.1.17RC2' will install the exact release candidate for PHP 7.1.17RC2



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Architecture <String>

The architecture of the PHP to be installed (x86 for 32-bit, x64 for 64-bit).



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ThreadSafe <Boolean>

A boolean value to indicate if the Thread-Safe version should be installed or not.

You usually install the ThreadSafe version if you plan to use PHP with Apache, or the NonThreadSafe version if

you'll use PHP in CGI mode.



Required? true

Position? 3

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Path <String>

The path of the directory where PHP will be installed.



Required? true

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TimeZone <String>

The PHP time zone to configure if php.ini does not exist (if not specified: we'll use UTC).



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AddToPath <String>

Specify if you want to add the PHP installation folder to the user ('User') or system ('System') PATH

environment variable.

Please remark that using 'System' usually requires administrative rights.



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-InitialPhpIni <String>

Specify to initialize the initial php.ini with the bundled php.ini-production ('Production') or with the

bundled php.ini-development ('Development').

If you don't specify this value, an almost empty php.ini will be created.



Required? false

Position? 7

Default value

Accept pipeline input? false

Accept wildcard characters? false



-InstallVC [<SwitchParameter>]

Specify this switch to try to install automatically the required Visual C++ Redistributables (requires the

VcRedist PowerShell package, and to run the process as an elevated user).



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Force [<SwitchParameter>]

Use this switch to enable installing PHP even if the destination directory already exists and it's not empty.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS





RELATED LINKS