-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwindows-support.html
376 lines (328 loc) · 15.4 KB
/
windows-support.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Windows Support in PHP 8.4, 8.3, 8.2, 7.4, 7.3, 7.1</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Lito && Óscar Otero">
<meta name="title" content="Windows Support in PHP 8.4, 8.3, 8.2, 7.4, 7.3, 7.1">
<meta property="og:type" content="website">
<meta property="og:url" content="https://eusonlito.github.io/php-changes-cheatsheet">
<meta property="og:title" content="Windows Support in PHP 8.4, 8.3, 8.2, 7.4, 7.3, 7.1">
<meta property="og:image" content="./images/social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="https://eusonlito.github.io/php-changes-cheatsheet">
<meta name="twitter:site" content="@lito_ordes">
<meta name="twitter:creator" content="@lito_ordes">
<meta name="twitter:title" content="Windows Support in PHP 8.4, 8.3, 8.2, 7.4, 7.3, 7.1">
<meta name="twitter:image" content="./images/social.png">
<link href="//fonts.googleapis.com/css?family=Fira+Sans|Droid+Sans|Source+Sans+Pro" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="./phpnet.css?1744308666" type="text/css" media="screen">
<link rel="stylesheet" href="./styles.css?1744308666" type="text/css" media="screen">
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="./favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="./favicon-16x16.png">
<link rel="icon" href="./favicon.ico" type="image/x-icon">
<meta name="theme-color" content="#ffffff">
</head>
<body class="docs">
<section class="info-wrapper">
<nav id="head-nav" class="navbar">
<h1><a href="index.html"> Windows Support in PHP 8.4, 8.3, 8.2, 7.4, 7.3, 7.1</a></h1>
</nav>
<main class="info-main">
<article id="layout-content" class="info-version">
<header class="info-version-header">
<h1><a href="https://www.php.net/manual/en/migration84.windows-support.php" target="_blank">PHP 8.4</a></h1>
</header>
<div id="migration84.windows-support" class="sect1">
<h2 class="title">Windows Support</h2>
<div class="sect2" id="migration84.windows-support.core">
<h3 class="title">Core</h3>
<p class="simpara">
Building with Visual Studio now requires at least Visual Studio 2019.
However, Visual Studio 2022 is recommended.
</p>
<p class="simpara">
AVX(2) CPU support is now properly detected for MSVC builds.
</p>
<p class="simpara">
Native AVX-512 builds are now supported via the
<strong class="option configure">--enable-native-intrinsics=avx512</strong>
configure option.
</p>
</div>
</div></article><article id="layout-content" class="info-version">
<header class="info-version-header">
<h1><a href="https://www.php.net/manual/en/migration83.windows-support.php" target="_blank">PHP 8.3</a></h1>
</header>
<div id="migration83.windows-support" class="sect1">
<h2 class="title">Windows Support</h2>
<div class="sect2" id="migration83.windows-support.core">
<h3 class="title">Core</h3>
<p class="para">
Minimum supported Windows version has been bumped to Windows 8 or
Windows Server 2012.
</p>
</div>
</div></article><article id="layout-content" class="info-version">
<header class="info-version-header">
<h1><a href="https://www.php.net/manual/en/migration82.windows-support.php" target="_blank">PHP 8.2</a></h1>
</header>
<div id="migration82.windows-support" class="sect1">
<h2 class="title">Windows Support</h2>
<div class="sect2" id="migration82.windows-support.core">
<h3 class="title">Core</h3>
<p class="para">
Windows specific error messages are no longer localized, but instead
always displayed in English to better match PHP error messages.
</p>
<p class="para">
Preliminary and highly experimental support for building on ARM64 has been added.
</p>
</div>
<div class="sect2" id="migration82.windows-support.oci8">
<h3 class="title">OCI8</h3>
<p class="para">
Because building against Oracle Client 10g is no longer supported anyway,
the configuration option <strong class="command">--with-oci8</strong> has been dropped.
The <strong class="command">--with-oci8-11g</strong>, <strong class="command">--with-oci8-12c</strong> and
<strong class="command">--with-oci8-19</strong> configuration options are still supported.
</p>
</div>
<div class="sect2" id="migration82.windows-support.zip">
<h3 class="title">Zip</h3>
<p class="para">
The Zip extension is upgraded to version 1.21.0,
and is now built as shared library (<abbr title="Dynamic Link Library">DLL</abbr>) by default.
</p>
</div>
</div></article><article id="layout-content" class="info-version">
<header class="info-version-header">
<h1><a href="https://www.php.net/manual/en/migration74.windows-support.php" target="_blank">PHP 7.4</a></h1>
</header>
<div id="migration74.windows-support" class="sect1">
<h2 class="title">Windows Support</h2>
<div class="sect2" id="migration74.windows-support.configure">
<h3 class="title"><strong class="command">configure</strong> flags</h3>
<p class="para">
<strong class="command">configure</strong> now regards additional <code class="literal">CFLAGS</code> and <code class="literal">LDFLAGS</code> set as environment
variables.
</p>
</div>
<div class="sect2" id="migration74.windows-support.other">
<h3 class="title">CTRL handling</h3>
<p class="para">
<kbd class="keycombo">
<kbd class="keycap">CTRL</kbd>
+<kbd class="keycap">C</kbd>
</kbd>
and
<kbd class="keycombo">
<kbd class="keycap">CTRL</kbd>
+<kbd class="keycap">BREAK</kbd>
</kbd>
on console can be caught by setting a handler function
with <span class="function"><a target="_blank" href="https://www.php.net/manual/en/function.sapi-windows-set-ctrl-handler.php" class="function">sapi_windows_set_ctrl_handler()</a></span>.
</p>
<p class="para">
<span class="function"><a target="_blank" href="https://www.php.net/manual/en/function.proc-open.php" class="function">proc_open()</a></span> on Windows can be passed a
"create_process_group" option. It is required if the child
process is supposed to handle CTRL events.
</p>
</div>
<div class="sect2" id="migration74.windows-support.opcache">
<h3 class="title">OPcache</h3>
<p class="para">
OPcache now supports an arbitrary number of separate caches per user via the
INI directive <code class="literal">opcache.cache_id</code>.
All processes with the same cache ID and user share an OPcache instance.
</p>
</div>
<div class="sect2" id="migration74.windows-support.stat">
<h3 class="title">stat</h3>
<p class="para">
The stat implementation has been refactored.
</p>
<ul class="itemizedlist"><li class="listitem">
<span class="simpara">
An inode number is delivered and is based on the NTFS file index.
</span>
</li>
<li class="listitem">
<span class="simpara">
The device number is now based on the volume serial number.
</span>
</li>
</ul><p class="para">
Note that both values are derived from the system and provided as-is on 64-bit
systems. On 32-bit systems, these values might overflow the 32-bit integer in
PHP, so they're fake.
</p>
</div>
<div class="sect2" id="migration74.windows-support.sqlite3">
<h3 class="title">libsqlite3</h3>
<p class="para">
libsqlite3 is no longer compiled statically into <var class="filename">php_sqlite3.dll</var>
and <var class="filename">php_pdo_sqlite.dll</var>, but rather available as <var class="filename">libsqlite3.dll</var>.
Refer to the installation instructions for <a target="_blank" href="https://www.php.net/manual/en/sqlite3.installation.php" class="link">SQLite3</a> and
<a target="_blank" href="https://www.php.net/manual/en/ref.pdo-sqlite.php#ref.pdo-sqlite.installation" class="link">PDO_SQLITE</a>, respectively.
</p>
</div>
</div></article><article id="layout-content" class="info-version">
<header class="info-version-header">
<h1><a href="https://www.php.net/manual/en/migration73.windows-support.php" target="_blank">PHP 7.3</a></h1>
</header>
<div id="migration73.windows-support" class="sect1">
<h2 class="title">Windows Support</h2>
<div class="sect2" id="migration73.windows-support.core">
<h3 class="title">PHP Core</h3>
<div class="sect3" id="migration73.windows-support.core.file-descriptors">
<h4 class="title">More POSIX Conforming File Deletion</h4>
<p class="para">
File descriptors are opened in shared read/write/delete mode by default.
This effectively maps the <abbr class="abbrev">POSIX</abbr> semantics and allows to
delete files with handles in use. It is not 100% same, some platform
differences still persist. After the deletion, the filename entry is
blocked, until all the opened handles to it are closed.
</p>
</div>
</div>
</div></article><article id="layout-content" class="info-version">
<header class="info-version-header">
<h1><a href="https://www.php.net/manual/en/migration71.windows-support.php" target="_blank">PHP 7.1</a></h1>
</header>
<div id="migration71.windows-support" class="sect1">
<h2 class="title">Windows Support</h2>
<div class="sect2" id="migration71.windows-support.long-and-utf8-path">
<h3 class="title">Support for long and UTF-8 path</h3>
<p class="para">
If a web application is UTF-8 conform, no further action is required. For
applications depending on paths in non UTF-8 encodings for I/O, an explicit
INI directive has to be set. The encoding INI settings check relies on the
order in the core:
</p>
<ul class="itemizedlist"><li class="listitem">
<span class="simpara">
internal_encoding
</span>
</li>
<li class="listitem">
<span class="simpara">
default_charset
</span>
</li>
<li class="listitem">
<span class="simpara">
zend.multibyte
</span>
</li>
</ul><p class="para">
Several functions for codepage handling were introduced:
</p>
<ul class="itemizedlist"><li class="listitem">
<span class="simpara">
sapi_windows_cp_set() to set the default codepage
</span>
</li>
<li class="listitem">
<span class="simpara">
sapi_windows_cp_get() to retrieve the current codepage
</span>
</li>
<li class="listitem">
<span class="simpara">
sapi_windows_cp_is_utf8()
</span>
</li>
<li class="listitem">
<span class="simpara">
sapi_windows_cp_conv() to convert between codepages, using iconv() compatible signature
</span>
</li>
</ul><p class="para">
These functions are thread safe.
</p>
<p class="para">
The console output codepage is adjusted depending on the encoding used in
PHP. Depending on the concrete system OEM codepage, the visible output
might or might be not correct. For example, in the default cmd.exe and on
a system with the OEM codepage 437, outputs in codepages 1251, 1252, 1253
and some others can be shown correctly when using UTF-8. On the same system,
chars in codepage like 20932 probably won't be shown correctly. This refers
to the particular system rules for codepage, font compatibility and the
particular console program used. PHP automatically sets the console codepage
according to the encoding rules from php.ini. Using alternative consoles
instead of cmd.exe directly might bring better experience in some cases.
</p>
<p class="para">
Nevertheless be aware, runtime codepage switch after the request start
might bring unexpected side effects on CLI. The preferable way is php.ini,
When PHP CLI is used in a console emulator, that doesn't support Unicode,
it might possibly be required, to avoid changing the console codepage. The
best way to achieve it is by setting the default or internal encoding to
correspond the ANSI codepage. Another method is to set the INI directives
output_encoding and input_encoding to the required codepage, in which case
however the difference between internal and I/O codepage is likely to cause
mojibake. In rare cases, if PHP happens to crash gracefully, the original
console codepage might be not restored. In this case, the chcp command
can be used, to restore it manually.
</p>
<p class="para">
Special awareness for the DBCS systems - the codepage switch on runtime
using <span class="function"><a target="_blank" href="https://www.php.net/manual/en/function.ini-set.php" class="function">ini_set()</a></span> is likely to cause display issues. The difference to the
non DBCS systems is, that the extended characters require two console cells
to be displayed. In certain case, only the mapping of the characters into
the glyph set of the font could happen, no actual font change. This is the
nature of DBCS systems, the most simple way to prevent display issues is
to avoid usage of <span class="function"><a target="_blank" href="https://www.php.net/manual/en/function.ini-set.php" class="function">ini_set()</a></span> for the codepage change.
</p>
<p class="para">
As a result of UTF-8 support in the streams, PHP scripts are not limited
to ASCII or ANSI filenames anymore. This is supported out of the box on
CLI. For other SAPI, the documentation for the corresponding server
is useful.
</p>
<p class="para">
Long paths support is transparent. Paths longer than 260 bytes get
automatically prefixed with <code class="literal">\\?\</code>. The max path length is limited to
2048 bytes. Be aware, that the path segment limit (basename length) still
persists.
</p>
<p class="para">
For the best portability, it is strongely recommended to handle filenames,
I/O and other related topics UTF-8. Additionally, for the console applications,
the usage of a TrueType font is preferable and the usage of ini_set() for
the codepage change is discouraged.
</p>
<p class="para">
</p>
<p class="para">
</p>
</div>
<div class="sect2" id="migration71.windows-support.readline">
<h3 class="title">readline</h3>
<p class="para">
The <a target="_blank" href="https://www.php.net/manual/en/book.readline.php" class="link">readline extension</a> is supported
through the <a target="_blank" href="https://www.php.net/manual/en/http://mingweditline.sourceforge.net/" class="link external">» WinEditLine
library</a>. Thereby, the interactive <abbr title="Command Line Interpreter/Interface">CLI</abbr> shell is
supported as well (<code class="literal">php.exe -a</code>).
</p>
</div>
<div class="sect2" id="migration71.windows-support.php-fcgi-children">
<h3 class="title">PHP_FCGI_CHILDREN</h3>
<p class="para">
<var class="varname">PHP_FCGI_CHILDREN</var> is now respected. If this environment variable is
defined, the first <var class="filename">php-cgi.exe</var> process will exec the specified number
of children. These will share the same TCP socket.
</p>
</div>
<div class="sect2" id="migration71.windows-support.ftok">
<h3 class="title">ftok()</h3>
<p class="para">
Added support for <span class="function"><a target="_blank" href="https://www.php.net/manual/en/function.ftok.php" class="function">ftok()</a></span>
</p>
</div>
</div></article> </main>
</section> </body>
</html>