私はそれを修正する方法を見つけました。それは私のパッチのコードです:
*** main/php_open_temporary_file.c.orig 2013-01-11 20:33:42.000000000 +0400
--- main/php_open_temporary_file.c 2013-01-11 21:17:44.000000000 +0400
***************
*** 101,113 ****
char cwd[MAXPATHLEN];
cwd_state new_state;
int fd = -1;
! #ifndef HAVE_MKSTEMP
! int open_flags = O_CREAT | O_TRUNC | O_RDWR
! #ifdef PHP_WIN32
! | _O_BINARY
! #endif
! ;
! #endif
if (!path || !path[0]) {
return -1;
--- 101,107 ----
char cwd[MAXPATHLEN];
cwd_state new_state;
int fd = -1;
! int open_flags = O_CREAT | O_TRUNC | O_RDWR;
if (!path || !path[0]) {
return -1;
***************
*** 144,169 ****
return -1;
}
- #ifdef PHP_WIN32
-
- if (GetTempFileName(new_state.cwd, pfx, 0, opened_path)) {
- /* Some versions of windows set the temp file to be read-only,
- * which means that opening it will fail... */
- if (VCWD_CHMOD(opened_path, 0600)) {
- efree(opened_path);
- free(new_state.cwd);
- return -1;
- }
- fd = VCWD_OPEN_MODE(opened_path, open_flags, 0600);
- }
-
- #elif defined(HAVE_MKSTEMP)
- fd = mkstemp(opened_path);
- #else
if (mktemp(opened_path)) {
! fd = VCWD_OPEN(opened_path, open_flags);
}
- #endif
if (fd == -1 || !opened_path_p) {
efree(opened_path);
--- 138,146 ----
return -1;
}
if (mktemp(opened_path)) {
! fd = VCWD_OPEN_MODE(opened_path, open_flags, 0660);
}
if (fd == -1 || !opened_path_p) {
efree(opened_path);
これで正常に動作しますが、「警告:move_uploaded_file():111行目の/path/to/script.phpで操作が許可されていません」という警告が表示されます。この警告を抑制する方法-わかりません。