IIS7.5/PHPv5.3.24 DiscuzX2.5上传文件出现Upload Error: 500的解决方法

添加了临时目录,重启IIS服务器后终于解决了。

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
upload_tmp_dir =C:\phpfileuploadtmp

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 24M

; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20

php Unicode 转换 ASCII


<?php 
$str = '我';

/* 将'我' 转换成'25105' 或'&#25105;' */ 
// 使用iconv 
$unicode_html = base_convert(bin2hex(iconv('UTF-8', 'UCS-4', $str)), 16, 10); // 25105

//使用mb_convert_encoding 
$unicode_html = base_convert(bin2hex(mb_convert_encoding($str, 'ucs-4', 'utf-8')), 16, 10); // 25105

// 补上&#xxxxx; 
$unicode_html = '&#' . base_convert(bin2hex(iconv("utf-8", "ucs-4", $str)), 16, 10) . ';'; // &#25105;

// 将&#25105 转回'我' 
$str = mb_convert_encoding($unicode_html, 'UTF-8', 'HTML-ENTITIES'); // '我', $unicode_html = '&#25105' 
?>