\u6700\u8fd1\u6709\u5ba2\u6236\u7684discuz\u8ad6\u58c7\uff0c\u56e0\u70ba\u9700\u4f7f\u7528\u7279\u6b8a api \uff0c\u6240\u4ee5\u9700\u8981\u5347\u7d1a\u4f7f\u7528 php 5.4 \uff0c
\n\u4f46\u5347\u7d1a\u5f8c\uff0c\u767c\u73fe\u6709\u76f8\u5bb9\u65bc php 5.4 \u7684\u554f\u984c\uff0c\u6240\u4ee5\u6211\u5011\u53c8\u8457\u624b\u5354\u52a9\u8655\u7406\u3002<\/p>\n
<\/p>\n
discuz php5.4\u7684\u554f\u984c\uff0c\u6839\u64dadiscuz\u8ad6\u58c7\u63d0\u4f9b\u7684\u8cc7\u6599 http:\/\/www.discuz.net\/thread-3095848-1-1.html<\/p>\n
\u539f\u4f86\u662f discuz \u672c\u8eab\u7684\u7a0b\u5f0f\u78bc\uff0c\u53ea\u6709\u76f8\u5bb9\u65bc\u00a0ISO-8859-1 \uff0c\u6240\u4ee5php 5.3 \u4e4b\u524d\u7684\u7248\u672c\u90fd\u6c92\u6709\u554f\u984c\uff0cphp 5.4 \u5247\u662f\u4f7f\u7528 utf8 \uff0c\u5247\u6703\u56e0\u6b64\u5c0e\u81f4\u4f7f\u7528\u5230ISO-8859-1\u7de8\u78bc\u7684\u529f\u80fd\u51fa\u932f\u3002<\/p>\n
— Begin opt ‘Deflate’ —<\/p>\n
— Begin step ‘to config options’ —
\n— End step ‘to config options’ —
\n— End opt ‘Deflate’ —<\/p>\n
— Begin opt ‘Expires’ —<\/p>\n
— Begin step ‘to config options’ —
\n— End step ‘to config options’ —
\n— End opt ‘Expires’ —<\/p>\n
— Begin opt ‘Mod FastCGI v2.3.9’ —
\n— Begin dryrun test ‘Store FCGID working directory’ —
\n— End dryrun test ‘Store FCGID working directory’ —
\n— Begin dryrun test ‘Patch mod_fcgid’ —
\nPatch tested at -p1; ..\/mod_fcgid_patches\/0001-only_signal_running.patch
\nApplying patch; ..\/mod_fcgid_patches\/0001-only_signal_running.patch
\npatching file modules\/fcgid\/fcgid_proc_unix.c
\nHunk #1 succeeded at 417 (offset -5 lines).
\n— End dryrun test ‘Patch mod_fcgid’ —<\/p>\n
— Begin step ‘Create task list to do after apache is built’ —
\n— End step ‘Create task list to do after apache is built’ —
\n— End opt ‘Mod FastCGI v2.3.9’ —<\/p>\n
— Begin opt ‘Fileprotect’ —
\n— Begin dryrun test ‘turning it on…’ —
\n— End dryrun test ‘turning it on…’ —<\/p>\n
— Begin step ‘Run \/usr\/local\/cpanel\/scripts\/enablefileprotect after Apache is installed’ —
\n— End step ‘Run \/usr\/local\/cpanel\/scripts\/enablefileprotect after Apache is installed’ —
\n— End opt ‘Fileprotect’ —<\/p>\n
— Begin opt ‘Headers’ —<\/p>\n
— Begin step ‘to config options’ —
\n— End step ‘to config options’ —
\n— End opt ‘Headers’ —<\/p>\n
— Begin opt ‘MPM Prefork’ —<\/p>\n
— Begin step ‘to config options’ —
\n— End step ‘to config options’ —
\n— End opt ‘MPM Prefork’ —<\/p>\n
— Begin opt ‘MemCache’ —<\/p>\n
— Begin step ‘to config options’ —
\n— End step ‘to config options’ —
\n— End opt ‘MemCache’ —<\/p>\n
— Begin opt ‘Proxy’ —<\/p>\n
— Begin step ‘Adding –enable-proxy to Apache configure line’ —
\n— End step ‘Adding –enable-proxy to Apache configure line’ —
\n— End opt ‘Proxy’ —<\/p>\n
— Begin opt ‘UniqueId’ —<\/p>\n
— Begin step ‘Applying EasyApache patches’ —
\nPatch tested at -p1; \/home\/cpeasyapache\/src\/cppatch\/0001-Provided-a-fallback-for-mod_unique_id-when-hostname-.patch
\nApplying patch; \/home\/cpeasyapache\/src\/cppatch\/0001-Provided-a-fallback-for-mod_unique_id-when-hostname-.patch
\npatching file modules\/metadata\/mod_unique_id.c
\n— End step ‘Applying EasyApache patches’ —<\/p>\n
— Begin step ‘to config options’ —
\n— End step ‘to config options’ —
\n— End opt ‘UniqueId’ —<\/p>\n
— Begin opt ‘Apache 2.2’ —
\n— Begin dryrun test ‘Applying patches if any’ —
\nPatch tested at -p1; ..\/cppatch\/2.2.6-ssl_engine_rand.patch
\nApplying patch; ..\/cppatch\/2.2.6-ssl_engine_rand.patch
\npatching file modules\/ssl\/ssl_engine_rand.c
\nPatch tested at -p1; ..\/cppatch\/2.2.8_ssl_scache_dbm.patch
\nApplying patch; ..\/cppatch\/2.2.8_ssl_scache_dbm.p<\/p>\n<\/div>\n<\/div>\n
4. \u6383\u4e86\u4e00\u4e0blog\uff0c\u770b\u5230\u7684\u78ba\u4e5f\u6709\u64fa\u653e source template \u7684\u4f4d\u7f6e\uff0c\u5927\u7d04\u662f\u5728\u00a0\u00a0\/var\/cpanel\/ \uff0c<\/span> 5. \u00a0cd \u00a0\/var\/cpanel\/perl\/easy\/Cpanel\/Easy\/PHP5 \u5f8c\uff0c\u5728\u4ed4\u7d30\u770b\u4e00\u4e0b\u8cc7\u6599\u593e\u5167\u7684\u8cc7\u6599\uff0c \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u767c\u73fe\u4e86 \u00a04_34.pm.tar.gz \uff0c\u89e3\u958b\u9019\u500b\u58d3\u7e2e\u6a94\uff0c ext\/standard\/html.c \u00a0\u679c\u7136\u8eb2\u5728\u9019\u88e1\uff0c ================================================================<\/p>\n \u4ee5\u4e0a\u662f\u900f\u904e\u4e3b\u6a5f\u7684\u89e3\u6cd5\u3002 \u53e6\u5feb\u4e5f\u53ef\u4ee5\u900f\u904e\u4fee\u6539\u7a0b\u5f0f\u53bb\u89e3\u6c7a(\u6bd4\u8f03\u80fd\u4e00\u52de\u6c38\u9038)<\/p>\n 1. \u00a0php\u7684\u5b98\u65b9\u7db2\u7ad9\uff0c\u4e5f\u6709\u5217\u51fa\u9019\u6a23\u7684\u554f\u984c\uff0c\u4ee5\u53ca\u5927\u7d04\u8981\u4fee\u6539\u7684\u8a9e\u6cd5:<\/span> 2. php \u5b98\u65b9\u771f\u662f\u76f8\u7576\u5730\u9ad4\u8cbc\uff0c \u628a\u5167\u5bb9\u53ca\u9664\u932f\u7684\u65b9\u5f0f\u90fd\u5beb\u7684\u5f88\u6e05\u695a(\u4e5f\u5c31\u662f\u5f37\u5236\u8b93\u8a9e\u6cd5\u4f7f\u7528<\/span> where you have only set 3. \u5728linux \u5e95\u4e0b\uff0c\u7528 grep \u5c31\u53ef\u4ee5\u5feb\u901f\u627e\u51fa\u6709\u554f\u984c\u7684\u5730\u65b9:<\/span> <\/p>\n ================================================<\/p>\n \u4ee5\u4e0a\u662f\u6211\u5011\u7684\u8655\u7406\u5fc3\u5f97\uff0c\u5e0c\u671b\u4e5f\u80fd\u89e3\u6c7a\u4f60\u7684\u554f\u984c!!<\/p>\n","protected":false},"excerpt":{"rendered":" \u6700\u8fd1\u6709\u5ba2\u6236\u7684discuz\u8ad6\u58c7\uff0c\u56e0\u70ba\u9700\u4f7f\u7528\u7279\u6b8a api \uff0c\u6240\u4ee5\u9700\u8981\u5347\u7d1a\u4f7f\u7528 php 5.4 \uff0c \u4f46\u5347\u7d1a\u5f8c\uff0c\u767c\u73fe\u6709 … \u95b1\u8b80\u5168\u6587 discuz \u8207\u76f8\u5bb9 php 5.4 \u7684\u554f\u984c<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[3,4],"tags":[214,34,163,164,166,165],"_links":{"self":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/888"}],"collection":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/comments?post=888"}],"version-history":[{"count":6,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/888\/revisions"}],"predecessor-version":[{"id":894,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/888\/revisions\/894"}],"wp:attachment":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/media?parent=888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/categories?post=888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/tags?post=888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\n\u00a0 \u00a0 \u00a0\u4f46\u4e0d\u592a\u78ba\u5b9a\uff0c\u53ea\u597d\u5728\u591a\u770b\u5e7e\u884c\uff0c \u53c8\u770b\u5230 ..\/cppatch\uff0c\u5728 locate cppatch \u771f\u5be6\u7684\u8def\u9015\uff0c<\/span>
\n\u00a0 \u00a0 \u00a0\u5728\u53bbvim \u6578\u500bxxx.path \uff0c \u770b\u5230\u4e86\u5728\u00a0\u00a0\/var\/cpanel\/perl\/easy\/Cpanel\/Easy\/PHP5\/ \u3002<\/span><\/p>\n
\n\u00a0 \u00a0 \u00a0\u4fee\u6539\u5b8c\uff0c\u5728\u4f7f\u7528 easyapache compile ….. finish<\/span> \u3002<\/span><\/span><\/p>\n
\n http:\/\/php.net\/manual\/en\/function.htmlspecialchars.php<\/span><\/p>\n
\n ISO-8859-1) \uff1a
\n<\/span>
\nAs of PHP 5.4 they changed default encoding from “ISO-8859-1” to “UTF-8”. So if you get null from htmlspecialchars or htmlentities<\/p>\n
\n<?php
\n<\/span>echo <\/span>htmlspecialchars<\/span>(<\/span>$string<\/span>);
\necho <\/span>htmlentities<\/span>(<\/span>$string<\/span>);
\n<\/span>?>
\n<\/span>
\nyou can fix it by
\n<?php
\n<\/span>echo <\/span>htmlspecialchars<\/span>(<\/span>$string<\/span>, <\/span>ENT_COMPAT<\/span>,<\/span>‘ISO-8859-1’<\/span>, <\/span>true<\/span>);
\necho <\/span>htmlentities<\/span>(<\/span>$string<\/span>, <\/span>ENT_COMPAT<\/span>,<\/span>‘ISO-8859-1’<\/span>, <\/span>true<\/span>);
\n<\/span>?><\/span><\/p>\n
\n On linux you can find the scripts you need to fix by<\/span>
\n grep -Rl “htmlspecialchars\\\\|htmlentities” \/path\/to\/php\/scripts\/<\/span><\/p>\n