{"id":103,"date":"2013-08-08T22:26:46","date_gmt":"2013-08-08T14:26:46","guid":{"rendered":"http:\/\/ufqi.com\/blog\/?p=103"},"modified":"2014-11-01T08:51:53","modified_gmt":"2014-11-01T00:51:53","slug":"apache2-2-resin4-php-resin-disable-quercus","status":"publish","type":"post","link":"https:\/\/ufqi.com\/blog\/apache2-2-resin4-php-resin-disable-quercus\/","title":{"rendered":"apache2.2 + resin4 \u7684PHP\u89e3\u6790\u554f\u984c\uff0c resin disable quercus"},"content":{"rendered":"<div>apache2.2 + resin4 \u7684PHP\u89e3\u6790\u554f\u984c,\uff0c resin disable quercus<\/div>\n<div><\/div>\n<div>\u96d6\u7136resin4\u5305\u542b\u4e86Quercus\uff0c\u80fd\u5920\u89e3\u6790PHP5\u8173\u672c\uff0c\u4f46\u662f\u56e0\u70ba\u9019\u73a9\u610f\u4e0d\u662f\u4e2d\u570b\u4eba\u958b\u767c\u7684\uff0c\u6c92\u6709\u5145\u5206\u8003\u616e\u5230\u591a\u5b57\u7bc0\u5b57\u7b26\u7684\u554f\u984c\uff0c\u5168\u90e8\u7528\u7684latin1\u7de8\u78bc\uff0c\u800c\u4e14\u9084\u786c\u7de8\u78bc\u5728\u6e90\u4ee3\u78bc\u4e2d\u4e86\uff0c\u5f88\u662f\u626f\u6de1\uff01<\/div>\n<div>\n\u6700\u8fd1\u6709\u4e00\u500bPHP\u7684\u9805\u76ee\u9700\u8981\u767c\u4f48\uff0c\u65bc\u662f\u7167\u5e38\u767c\u4f48\u5230\u4e86apache\u4e2d\uff0c\u4e26\u5728resin\u7684conf\/app-default.xml\u914d\u7f6e\u6587\u4ef6\u4e2d\u5c07PHP\u76f8\u95dc\u914d\u7f6e\u7d66\u8a3b\u91cb\u6389\u4e86\uff0c\u4ee5\u70ba\u9019\u6a23\u5c31\u53ef\u4ee5\u5c07PHP\u7684\u89e3\u6790\u4ea4\u7d66apache\u8655\u7406\u4e86\uff0c\u5c31\u50cf\u4e4b\u524d\u7684resin3\u4e00\u6a23\u3002\u7d50\u679c\u537b\u8b49\u660e\u5b8c\u5168\u60f3\u932f\u4e86\uff0c\u7d93\u904e\u4e00\u756a\u6298\u9a30\uff0c\u89e3\u6c7a\u8fa6\u6cd5\u5982\u4e0b\uff1a<\/div>\n<div><\/div>\n<div>resin\u7684conf\/app-default.xml\u9084\u5f97\u7167\u6539\u4e0d\u8aa4\uff0c\u4f46\u662f\u9084\u5f97\u4fee\u6539conf\/resin.xml\u6587\u4ef6 (<span style=\"color: #ff0000\">wadelau\u6ce8\uff1a resin-4.0.35\u4e4b\u540e\uff0c\u9700\u8981\u5728 conf\/cluster-default.xml\u91cc\u627e\u4e0b\u9762\u7684\u9ad8\u4eae\u8bed\u53e5<\/span>)\uff0c\u5728\u9019\u500b\u6587\u4ef6\u4e2d\u627e\u5230\u4ee5\u4e0b\u4f4d\u7f6e\uff1a<\/div>\n<div>&lt;cluster-default&gt;<br \/>\n&lt;!&#8211; shared webapp jars for non-classloader-aware libraries &#8211;&gt;<br \/>\n&lt;web-app-default&gt;<br \/>\n&lt;class-loader&gt;<br \/>\n&lt;library-loader path=&#8221;${resin.home}\/webapp-jars&#8221;\/&gt;<br \/>\n&lt;\/class-loader&gt;<br \/>\n&lt;\/web-app-default&gt;<\/div>\n<div>\u00a0\u00a0\u00a0 &lt;!&#8211; standard servlet behavior, including .jsp, .php, and WEB-INF &#8211;&gt;<br \/>\n<span style=\"color: #ff0000\">\u00a0\u00a0<span> <strong>&lt;resin:import path=&#8221;classpath:META-INF\/caucho\/app-default.xml&#8221;\/&gt;<\/strong><\/span><\/span><\/div>\n<div><span style=\"color: #ff0000\"><strong><\/strong>\u00a0<\/span><\/div>\n<div>\u8acb\u6ce8\u610f\u4e0a\u9762\u7d05\u8272\u52a0\u7c97\u7684\u9019\u884c\uff0c\u9019\u884c\u7684\u610f\u601d\u662f\u5f9eclasspath\u8def\u5f91\u4e2d\u641c\u5c0bMETA-INF\/caucho\/app-default.xml\u6587\u4ef6\uff0c\u719f\u6089java\u958b\u767c\u7684\u670b\u53cb\u61c9\u8a72\u77e5\u9053classpath\u7684\u641c\u7d22\u8def\u5f91\u4e0d\u50c5\u50c5\u5305\u62ec\u6587\u4ef6\u593e\uff0c\u9084\u53ef\u4ee5\u662fjar\u5305\uff0c\u800cMETA-INF\/caucho\/app-default.xml\u6070\u6070\u5c31\u5728resin\u7684lib\/resin.jar\u5305\u4e2d\uff0c\u9019\u500b\u5305\u4e2d\u679c\u7136\u4e5f\u6709\u4e00\u500bapp-default.xml\u6587\u4ef6\uff0c\u5167\u5bb9\u8207conf\/app-default.xml\u4e00\u6a21\u4e00\u6a23\uff0c\u5982\u679c\u60f3\u8b93resin\u5fb9\u5e95\u7684\u4e0d\u89e3\u6790PHP\uff0c\u90a3\u9ebc\u5c07\u9019\u500b\u6587\u4ef6\u4e2d\u7684PHP\u914d\u7f6e\u4e5f\u8a3b\u91cb\u6389\u5c31\u53ef\u4ee5\u4e86\u3002\u4f46\u5728\u9019\u88e1\u6211\u4e0d\u9019\u9ebc\u505a\uff0c\u56e0\u70ba\u8981\u89e3\u5305\uff0c\u6539\u597d\u4e86\u9084\u8981\u518d\u91cd\u65b0\u6253\u5305\uff0c\u5f88\u8a0e\u4eba\u5acc\uff01\u54b1\u4e0d\u662f\u5c07conf\/app-default.xml\u6539\u597d\u4e86\u55ce\uff1f\u90a3\u5c31\u628a\u9019\u884c\u7d66\u7d66\u63db\u6389\u4e0d\u5c31\u884c\u4e86\u55ce\uff1f\u6539\u6210\u4e0b\u9762\u9019\u884c\u5373\u53ef\uff1a<\/div>\n<div>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;resin:import path=&#8221;${__DIR__}\/app-default.xml&#8221;\/&gt;<\/div>\n<div><span style=\"color: #ff0000\">\uff08\u6ce8\u610f\uff1a\u9019\u884c\u6539\u4e86\u4e4b\u5f8c\uff0cresin-admin\u5c31\u4e0d\u80fd\u7528\u4e86\uff0c\u63d0\u793a404\u6587\u4ef6\u672a\u627e\u5230\u3002\u627e\u5230resin-admin\u7684WEB-INF\u76ee\u9304\uff0c\u67e5\u770bresin-web.xml\u6587\u4ef6\uff0c\u767c\u73fe\u9019\u500b\u6587\u4ef6\u4e2d\u52a0\u8f09\u4e86Quercus\uff0c\u90a3\u9ebc\u6309\u9053\u7406resin-admin\u61c9\u8a72\u9084\u662f\u7531resin\u89e3\u6790\u7684\uff0c\u4e0d\u61c9\u8a72\u4e0d\u80fd\u7528\uff0c\u6298\u9a30\u4e86\u597d\u4e45\uff0c\u731b\u7136\u60f3\u5230\u662f\u4e0d\u662f\u6b61\u8fce\u9801\u4e2d\u6c92\u6709index.php\u5462\uff1f\u4ed4\u7d30\u4e00\u67e5\u770b\uff0c\u679c\u7136\u5982\u6b64\u3002\u51a4\u6789\u6b7b\u4e86\u597d\u591a\u8166\u7d30\u80de\u3002\uff09<\/span><\/div>\n<div>\u9019\u500b${__DIR__}\u5728resin\u914d\u7f6e\u6587\u4ef6\u4e2d\u662f\u4ee3\u8868resin\u7684conf\u76ee\u9304\u8def\u5f91\u7684\uff0c\u9019\u53e5\u7684\u610f\u601d\u4e5f\u5c31\u662f\u5c0e\u5165conf\u76ee\u9304\u4e0b\u7684app-default.xml\u6587\u4ef6\u3002\u597d\u4e86\uff0c\u73fe\u5728\u5237\u65b0\u4e00\u4e0b\u700f\u89bd\u5668\uff0cPHP\u61c9\u7528\u679c\u7136\u4ea4\u7d66apache\u8655\u7406\u4e86\uff0c\u4e0d\u904e\u554f\u984c\u53c8\u4f86\u4e86\uff0c\u96d6\u7136PHP\u7684\u8655\u7406\u6b0a\u662f\u4ea4\u7d66apache\u4e86\uff0c\u4f46\u9801\u9762\u537b\u986f\u793a\u6e90\u78bc\uff0c\u70ba\u4e86\u89e3\u6c7a\u9019\u500b\u554f\u984c\uff0c\u6211\u7528PHP\u5beb\u4e86\u500bshell\u8173\u672c\uff0dtest.php\uff0c\u5167\u5bb9\u5982\u4e0b\uff1a<\/div>\n<div>#!\/usr\/bin\/php -q<br \/>\n&lt;?<br \/>\necho &#8220;a test!~~&#8221;;<br \/>\n?&gt;<\/div>\n<div>\u4fdd\u5b58\u9000\u51fa\uff0c\u4e26\u4fee\u6539\u70ba\u53ef\u57f7\u884c\u6b0a\u9650\uff1a<br \/>\nchmod +x test.php<\/div>\n<div>\u904b\u884c\u5b83\uff1a.\/test.php<\/div>\n<div>\u7d50\u679c\u767c\u73fe\u63a7\u5236\u53f0\u4e0a\u4e5f\u6253\u5370\u51fa\u6e90\u4ee3\u78bc\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/div>\n<div>[root@www shine]# .\/test.php<br \/>\n&lt;?<br \/>\necho &#8220;a test!~~&#8221;;<br \/>\n?&gt;<br \/>\n\u65bc\u662f\u53ef\u4ee5\u80af\u5b9a\u6b64\u554f\u984c\u4e0d\u662f\u56e0\u70baapache\u4e0d\u80fd\u8b58\u5225php\u8173\u672c\uff0c\u800c\u662fphp\u672c\u8eab\u7684\u554f\u984c\uff0c\u6839\u64da\u4ee5\u5f80\u7684\u7d93\u9a57\uff0c\u7a81\u7136\u60f3\u5230PHP\u8173\u672c\u7684\u958b\u59cb\/\u7d50\u675f\u7b26\u53ef\u4ee5\u7528&lt;? ?&gt;\uff0c\u4e5f\u53ef\u4ee5\u7528&lt;?php ?&gt;\uff0c\u524d\u8005\u662f\u77ed\u98a8\u683c\uff0c\u5f8c\u8005\u662f\u9577\u98a8\u683c\uff0c\u5177\u9ad4\u53ef\u4ee5\u4f7f\u7528\u54ea\u7a2e\u98a8\u683c\uff0c\u9700\u8981\u4fee\u6539php.ini\u6587\u4ef6\u4e2d\u7684\u76f8\u61c9\u914d\u7f6e\u9805\uff0c\u65bc\u662f\u7de8\u8f2f\/etc\/php.ini\uff0c\u627e\u5230 short_open_tag = Off\u00a0 \u9019\u4e00\u884c\uff0c\u5c07Off\u6539\u6210On\u5373\u53ef\uff0c\u4fdd\u5b58\u9000\u51fa\uff0c\u91cd\u555fapache\uff0c\u518d\u5237\u65b0\u700f\u89bd\u5668\uff0cphp\u89e3\u6790\u6062\u5fa9\u6b63\u5e38\uff0c\u554f\u984c\u89e3\u6c7a\u3002<\/div>\n<div><\/div>\n<div><a href=\"http:\/\/www.360doc.com\/content\/12\/0229\/10\/834950_190485248.shtml\">http:\/\/www.360doc.com\/content\/12\/0229\/10\/834950_190485248.shtml<\/a><\/div>\n<div><\/div>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>apache2.2 + resin4 \u7684PHP\u89e3\u6790\u554f\u984c,\uff0c resin disa &hellip; <a href=\"https:\/\/ufqi.com\/blog\/apache2-2-resin4-php-resin-disable-quercus\/\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,2],"tags":[],"_links":{"self":[{"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/posts\/103"}],"collection":[{"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/comments?post=103"}],"version-history":[{"count":3,"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":105,"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/posts\/103\/revisions\/105"}],"wp:attachment":[{"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/media?parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/categories?post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/tags?post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}