Installing ZendPHP on Windows (MSI package)
This topic describes the default procedure for installing ZendPHP on Windows using a Microsoft Installer (MSI) Package. It replaces the legacy PowerShell installation.
Requirements
-
Windows 10 or 11
-
Windows Server 2016 or 2019
-
64-bit architecture only
Getting the installer
Download the MSI file for the desired version from repos.zend.com:
-
https://repos.zend.com/zendphp/windows/latest/zendphp-7.2-latest-nts-x64.msi
-
https://repos.zend.com/zendphp/windows/latest/zendphp-7.3-latest-nts-x64.msi
-
https://repos.zend.com/zendphp/windows/latest/zendphp-7.4-latest-nts-x64.msi
-
https://repos.zend.com/zendphp/windows/latest/zendphp-8.0-latest-nts-x64.msi
-
https://repos.zend.com/zendphp/windows/latest/zendphp-8.1-latest-nts-x64.msi
-
https://repos.zend.com/zendphp/windows/latest/zendphp-8.2-latest-nts-x64.msi
-
https://repos.zend.com/zendphp/windows/latest/zendphp-8.3-latest-nts-x64.msi
When prompted for username and password, use the credentials you were provided on purchase of your ZendPHP licenses to download those files.
Alternatively, provide your credentials before the host name. For example, to download version 8.3:
https://USERNAME:PASSWORD@repos.zend.com/zendphp/windows/latest/zendphp-8.3-latest-nts-x64.msi
Installing Features
You have two options when using the MSI installer to install ZendPHP: the graphical installer or the Command Line.
-
The most common way is to open the MSI file in the Windows Explorer, then following the instructions in the installer window. In this window, you also accept the license terms, select the features, extensions, and Apache.
-
Installing on the Command Line is a special scenario for experienced users. For more information about the Microsoft Installer command, see the official msiexec documentation. To install all features belonging to a level listed in the table, specify the INSTALLLEVEL property value when running msiexec. You can provide only one level value. To install certain features, specify the ADDLOCAL command line property as comma-separated list of identifiers from the table. The special value ALL selects all features.
Feature identifier
|
Feature level
|
Description
|
---|---|---|
PHP_main |
1 |
Main PHP binaries, excluding all loadable extensions and optional dependencies |
PHP_bz2 |
2 |
bz2 extension |
PHP_com_dotnet |
2 |
com_dotnet extension |
PHP_curl |
2 |
curl extension |
PHP_enchant |
2 |
enchant extension |
PHP_exif |
2 |
exif extension |
PHP_ffi |
2 |
ffi extension (PHP >=7.4) |
PHP_fileinfo |
2 |
fileinfo extension |
PHP_ftp |
2 |
ftp extension |
PHP_gd |
2 |
gd extension |
PHP_gettext |
2 |
gettext extension |
PHP_gmp |
2 |
gmp extension |
PHP_igbinary |
2 |
igbinary PECL extension |
PHP_imagick |
2 |
imagick PECL extension |
PHP_imap |
2 |
imap extension |
PHP_intl |
2 |
intl extension |
PHP_ldap |
2 |
ldap extension |
PHP_mbstring |
2 |
mbstring extension |
PHP_memcache |
2 |
memcache extension |
PHP_mongodb |
2 |
mongodb PECL extension |
PHP_mysql |
2 |
mysqli and pdo_mysql extensions |
PHP_oci |
2 |
oci8 and pdo_oci extensions |
PHP_odbc |
2 |
odbc and pdo_odbc extensions |
PHP_opcache |
2 |
opcache extension |
PHP_openssl |
2 |
openssl extension |
PHP_pgsql |
2 |
pgsql and pdo_pgsql extensions |
PHP_phar |
2 |
phar extension |
PHP_redis |
2 |
redis PECL extension |
PHP_shmop |
2 |
shmop extension |
PHP_snmp |
2 |
snmp extension |
PHP_soap |
2 |
soap extension |
PHP_sockets |
2 |
sockets extension |
PHP_sodium |
2 |
sodium extension |
PHP_sqlite |
2 |
sqlite3 and pdo_sqlite extensions |
PHP_sqlsrv* |
2 |
sqlsrv and pdo_sqlsrv extensions |
PHP_ssh2 |
2 |
ssh2 PECL extension |
PHP_sysvshm |
2 |
sysvshm extension |
PHP_tidy |
2 |
tidy extension |
PHP_tokenizer |
2 |
tokenizer extension |
PHP_wddx |
2 |
wddx extension (PHP <=7.3) |
PHP_win32service |
2 |
win32service extension |
PHP_xdebug |
2 |
xdebug extension |
PHP_xmlrpc |
2 |
xmlrpc extension (PHP <= 7.4) |
PHP_xsl |
2 |
xsl extension |
PHP_zendhq |
2 |
ZendHQ extension |
DEBUG |
2 |
debug symbol files for all PHP binaries in the package |
ZEND_APACHE |
3 |
Apache 2.4 with PHP configuration |
Installation command examples
If you are not using the ZendHQ User Interface, you will use the command line. The MSI command has the following arguments:
# msiexec.exe /i /a <msi_file> [ADDLOCAL=feature1[,feature2...]] [INSTALLEVEL=<level>] [REMOVE=feature1[,feature2,...]] [/quiet]
The INSTALLLEVEL argument is mutually exclusive with REMOVE and ADDLOCAL.
The following example shows a standard installation using INSTALLLEVEL:
# example for full install quietly without UI msiexec /i zendphp-8.2.6-nts-x64.msi INSTALLLEVEL=3 /quiet
The following examples show custom installations using ADDLOCAL and REMOVE:
# example for installing PHP with curl extension for cli use without APACHE msiexec /i zendphp-8.2.6-nts-x64.msi ADDLOCAL=PHP_main,PHP_curl /quiet
# example for installing PHP with all provided extensions except OCI extensions and Apache msiexec /i zendphp-8.2.5-nts-x64.msi ADDLOCAL=ALL REMOVE=PHP_oci,ZEND_APACHE
# example for installing PHP with Apache and sqlite extensions msiexec /i zendphp-8.2.5-nts-x64.msi ADDLOCAL=PHP_sqlite,ZEND_APACHE
Validating
After the installation, the default Apache configuration creates a sample page at http://<ip_address>/php<MAJOR>.<MINOR>
for validation. For example, open http://127.0.0.1/php8.2
to validate that PHP 8.2 is running.
Verify that Windows Start Menu shortcuts have been created.
Installation directory structure
After the installation, familiarize yourself with the directory structure and edit the configuration files as needed. Change the web hosting directories in the Apache configuration files (ZendPHP specific setup) and provide your production web app instead of the included sample app.
The base directory may differ in different operating systems, therefore we refer to it as <BASE_DIR> in this documentation; the default 64-bit programs directory is C:\Program Files\. The default installation directory cannot be changed.
-
<BASE_DIR>\Zend\Apache24
Contains Apache 2.4 files. Common for all ZendPHP versions. -
<BASE_DIR>\Zend\Apache24\conf
Contains Apache configuration files. -
<BASE_DIR>\Zend\Apache24\conf\ZendPHP
Contains ZendPHP configuration files for Apache web server. Included from <BASE_DIR>\Apache24\conf\httpd.conf. -
<BASE_DIR>\Zend\Apache24\htdocs\ZendPHP\<MAJOR>.<MINOR>
Contains a sample application for a PHP- version-specific web page. Defined in <BASE_DIR>\Apache24\conf\ZendPHP\ZendPHP<MAJOR>.<MINOR>_dir.conf.
For production, define this value to point to your actual PHP application using a vhost configuration; a sample configuration for the vhost setup is provided in the Apache configuration directory for ZendPHP. -
<BASE_DIR>\Zend\ZendPHP
The base directory for ZendPHP PHP files. -
<BASE_DIR>\Zend\ZendPHP\<MAJOR>.<MINOR>
The subdirectory for ZendPHP version-specific files. Contains php executable files and dependency libraries. -
<BASE_DIR>\Zend\ZendPHP\<MAJOR>.<MINOR>\etc
Contains ZendPHP version-specific configuration files, including php.ini. -
<BASE_DIR>\Zend\ZendPHP\<MAJOR>.<MINOR>\etc\conf.d
Contains ZendPHP extensions configuration files. The files have the .ini extension and their names are prefixed with a prioritization number to force the required loading sequence of extensions. Do not change these prefixes. -
<BASE_DIR>\Zend\ZendPHP\<MAJOR>.<MINOR>\ext
Contains ZendPHP extension modules. -
<BASE_DIR>\Zend\ZendPHP\<MAJOR>.<MINOR>\*-doc
Contains documentation and information about PECL extensions. -
<BASE_DIR>\Zend\ZendPHP\<MAJOR>.<MINOR>\licenses
Contains license files for PHP and the dependency modules included in this package. -
C:\usr\share\snmp\mibs
Contains SNMP extension data. Only installed when you have selected the SNMP extension. -
C:\usr\snmp
Contains SNMP extension data. Created by the SNMP library.
SSL setup
The Secure Sockets Layer (SSL) for HTTPS requires customer certificates that you need to set up yourself. The ZendPHP installer does not provide such functionality.
For more information on SSL setup, see https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html.
Updating
To update or change features, run the MSI file from Windows Explorer again, or use the Windows Control Panel tools.
The third option is to use msiexec's REMOVE property in combination with ADDLOCAL to remove features on the Command Line. Do not combine INSTALLLEVEL with REMOVE or ADDLOCAL.
# example for removing sqlsrv and pdo_sqlsrv extensions # from current installation quietly without UI msiexec /i zendphp-8.2.6-nts-x64.msi REMOVE=sqlsrv /quiet
Uninstalling
An uninstall shortcut for the current version is created when installing the MSI package. The package code is included in the shortcut parameter.
ZendPHP packages can be removed using Windows Control Panel tools. You can uninstall the current version by re-running the package MSI file.
Advanced users can uninstall a different version by providing a specific package code on the command line. To be able to provide upgrade functionality with MSI, the package codes change for each new build. You find the list of packages installed and their the package codes in the Windows Registry under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.
# msiexec.exe /x <package_code>
For example, to remove the ZendPHP 8.2 package quietly without opening a graphical user interface, use the following command. The GUID below is just a sample, enter your package code for the specific package.
msiexec /x {B28B3FA8-9310-4AA7-B0CA-CBCCA5FD82BC} /quiet