internals:windows:stepbystepbuild_sdk_2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
internals:windows:stepbystepbuild_sdk_2 [2019/06/06 11:15] – Clarify platform toolset support cmbinternals:windows:stepbystepbuild_sdk_2 [2021/08/06 15:23] – note about updating VS; see https://bugs.php.net/81337 cmb
Line 17: Line 17:
  
   * Visual C++ 14.0 (Visual Studio 2015) for **PHP 7.0** or **PHP 7.1**.   * Visual C++ 14.0 (Visual Studio 2015) for **PHP 7.0** or **PHP 7.1**.
-  * Visual C++ 15.0 (Visual Studio 2017) for **PHP 7.2** or **PHP 7.3**. +  * Visual C++ 15.0 (Visual Studio 2017) for **PHP 7.2****PHP 7.3** or **PHP 7.4**. 
-  * Visual C++ 16.0 (Visual Studio 2019) for **PHP 7.4**.+  * Visual C++ 16.0 (Visual Studio 2019) for **master**
 + 
 +Always keep your installed Visual C++ up to date. Otherwise build errors may occur due to dependencies built with newer versions.
  
 Support for a certain Visual Studio version means only support for its default platform toolset; building PHP with a non-default platform toolset (such as 14.16 with Visual Studio 2019) may work, but is not recommended. Support for a certain Visual Studio version means only support for its default platform toolset; building PHP with a non-default platform toolset (such as 14.16 with Visual Studio 2019) may work, but is not recommended.
  
-In filenames (and the ''PHP_SDK_VS'' environment variable; see below) the Visual Studio version is usually abbreviated. Before Visual Studio 2019, the abbreviation used the scheme "vc#" (for instance, "vc14"). This number ("#") has tradionally been the major number of the respective platform toolset. The preview releases of Visual Studio 2017 shipped with platform toolset 15.00, so "vc15" was used. The first GA release of Visual Studio 2017, however, shipped with platform toolset 14.10 (to signal the backward compatibility), but the internal Visual Studio version number stayed 15.00. To avoid confusion "vc15" has been kept. For the Visual Studio 2019 builds (PHP 7.4 and master), the "vc#" has finally been changed to "vs#" (note the "s"), where the number now designates the major internal Visual Studio version number.+In filenames (and the ''PHP_SDK_VS'' environment variable; see below) the Visual Studio version is usually abbreviated. Before Visual Studio 2019, the abbreviation used the scheme "vc#" (for instance, "vc14"). This number ("#") has tradionally been the major number of the respective platform toolset. The preview releases of Visual Studio 2017 shipped with platform toolset 15.00, so "vc15" was used. The first GA release of Visual Studio 2017, however, shipped with platform toolset 14.10 (to signal the backward compatibility), but the internal Visual Studio version number stayed 15.00. To avoid confusion "vc15" has been kept. For the Visual Studio 2019 builds (master), the "vc#" has finally been changed to "vs#" (note the "s"), where the number now designates the major internal Visual Studio version number.
  
 ==== Setup ==== ==== Setup ====
Line 33: Line 35:
   * If compiling **PHP 7.2+**:   * If compiling **PHP 7.2+**:
     * Install Visual Studio 2017     * Install Visual Studio 2017
-  * If compiling **PHP 7.4+**:+  * If compiling **master**:
     * Install Visual Studio 2019     * Install Visual Studio 2019
  
Line 135: Line 137:
  
 At this point, your compiled extension will be located in the release directory. At this point, your compiled extension will be located in the release directory.
 +
 +==== Release directories ====
 +
 +When you have successfully compiled PHP, the release directory can be one of multiple, depending on the build configuration:
 +
 +    - `Release`: Release NTS build
 +    - `Release_TS`: Release ZTS build
 +    - `Debug`: Debug NTS build
 +    - `Debug_TS`: Debug ZTS build
 +
 +If you are compiling using a 64-bit compiler, then these directories will be located in a directory called `x64`.
  
 ===== Pitfalls ===== ===== Pitfalls =====
Line 140: Line 153:
   - For possible PHP SDK issues, please consult the PHP SDK readme   - For possible PHP SDK issues, please consult the PHP SDK readme
   - As of PHP 7.3 the switch --enable-native-intrinsics is available. The resulting binary will then require a processor with the corresponding feature set available. For example, if you set --enable-native-intrinsics=avx2, be sure the target machine has processor with AVX2 support.   - As of PHP 7.3 the switch --enable-native-intrinsics is available. The resulting binary will then require a processor with the corresponding feature set available. For example, if you set --enable-native-intrinsics=avx2, be sure the target machine has processor with AVX2 support.
 +  - In some circumstances, you may hit the [[https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1047?view=msvc-160|linker error C1047]]; you may be able to work around that with ''set LDFLAGS=/d2:-AllowCompatibleILVersions'' and re-configuring the build.
  
  
internals/windows/stepbystepbuild_sdk_2.txt · Last modified: 2022/01/10 09:43 by cmb