{"id":539,"date":"2008-08-06T00:00:00","date_gmt":"2008-08-05T16:00:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=539"},"modified":"2023-11-04T00:01:17","modified_gmt":"2023-11-03T16:01:17","slug":"php%e5%ae%89%e8%a3%9d","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/539","title":{"rendered":"PHP\u5b89\u88dd"},"content":{"rendered":"\n<p>php<br>(http:\/\/www.php.net\/)<br><br>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br><br>php\u5b89\u88dd<br>1<br>.\/configure \/\/\u7522\u751fmakefile<br>&nbsp;&#8211;with-apxs2=&nbsp; \/\/\u6307\u5b9aapache\u63d0\u4f9b\u7684apxs\u7684\u8def\u5f91,\u7528\u4f86\u5c07php\u4ee5\u6a21\u7d44\u5316\u65b9\u5f0f\u5d4c\u5165apache\u63d0\u5347\u88ab\u57f7\u884c\u6548\u7387(\u901a\u5e38\u5728bin\/)<br>&nbsp;&#8211;with-mysql=&nbsp; \/\/\u8981\u652f\u63f4mysql\u9700\u6307\u5b9a\u5b89\u88dd\u8def\u5f91(\u901a\u5e38\u5728usr\/include\/mysql)\uff0c\u7121\u6307\u5b9a\u5247\u63a1\u9810\u8a2d\u503c<br>&nbsp;&#8211;with-gd=&nbsp; \/\/\u8981\u652f\u63f4gd\u6a21\u7d44\u9700\u6307\u5b9a\u6240\u5728\u76ee\u9304<br>&nbsp;&#8211;with-jpeg-dir= \/\/\u8def\u5f91\u70bajpeg\u5b89\u88dd\u4f4d\u7f6e<br>&nbsp;&#8211;with-zlib-dir= \/\/\u8def\u5f91\u70bazlib\u5b89\u88dd\u4f4d\u7f6e\u7684\/include<br>&nbsp;&#8211;enable-[sockets|ftp|&#8230;]<br>2<br>make<br>make install<br>3<br>\u78ba\u5b9aapache\/modules\u5167\u6709libphp*.so\u6a21\u7d44,\u4ee5\u53cahttpd.conf\u5167\u6709<br>loadmodule php*_module&nbsp;&nbsp; modules\/libphp*.so<br>addtype application\/x-httpd-php .php .phtml<br>\u4e26\u628aphp.ini-dist(\u539f\u59cb\u6a94\u5167)\u8907\u88fd\u5230php\u5b89\u88dd\u76ee\u9304\u7684\/lib\u5167\u4e26\u6539\u6210php.ini,\u5728\u5c07\u8a72\u6a94\u5167\u7684register_globals=on<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<\/p>\n\n\n\n<p>\/etc\/php.ini<br>PHP\u4e3b\u8981\u8a2d\u5b9a\u6a94<br><br>\/etc\/httpd\/conf.d\/php.conf<br>PHP\u8a2d\u5b9a\u53c3\u6578\u5df1\u5beb\u5165\u6b64\u6a94,Apache\u91cd\u65b0\u555f\u52d5\u6642\u6703\u8b80\u5165<br><br>\/usr\/lib\/httpd\/modules\/libphp4.so<br>\u8b93Apache\u80fd\u5920\u8dd1php\u7684\u6a21\u7d44<br><br>\/etc\/php.d\/mysql.ini, \/usr\/lib\/php4\/mysql.so<br>\u8b93PHP\u652f\u63f4MySQL\u7684\u6a21\u7d44,\u7531php-mysql\u5957\u4ef6\u63d0\u4f9b<br><br>\/usr\/bin\/phpize, \/usr\/include\/php\/<br>\u5b89\u88dd\u985e\u4f3cPHP\u52a0\u901f\u5668\u9700\u8981\u7684\u8cc7\u6599,\u7531php-devel\u5957\u4ef6\u63d0\u4f9b<br><br>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<br><br>\u548capache httpd.conf\u5408\u7528<br>web\u76ee\u9304\u70ba\/usr\/local\/apache\/htdocs\uff0c\u5728httpd.conf\u88e1\u52a0\u4e0a\u9019\u5e7e\u884c\uff1a<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp; php_admin_value open_basedir \/usr\/local\/apache\/htdocs<br>&nbsp;&nbsp;<br>\u5982\u679c\u8173\u672c\u8981\u8b80\u53d6\/usr\/local\/apache\/htdocs\u4ee5\u5916\u7684\u6587\u4ef6\u5c07\u4e0d\u6703\u88ab\u5141\u8a31<br><br>php\u5ef6\u4f38\u6a21\u7d44\uff0cZendOptimizer<br>\u53ef\u52a0\u901fphp\u57f7\u884c\u6548\u80fd<br>1\u5230www.zend.com\u514d\u8cbb\u4e0b\u8f09<br>2\u8a2d\u5b9aphp.ini\u70ba<br>&nbsp;zend_optimizer.optimization_level=15<br>&nbsp;zend_extension=&#8221;\/usr\/local\/lib\/php\/extensions\/ZendOptimizer.so&#8221;<br><br>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<br><br>php.ini\u91cd\u8981\u53c3\u6578<br>short_open_tag=On \/\/\u53ef\u4ee5\u4f7f\u7528\u77ed\u6a19\u8a18\u5982:,\u4f46\u5efa\u8b70\u4f7f\u7528<br>display_errors=Off \/\/\u95dc\u9589\u932f\u8aa4\u986f\u793a\uff0c\u53ef\u9632\u653b\u64ca\u8005\u5f9e\u932f\u8aa4\u4fe1\u606f\u5f97\u77e5\u8173\u672c\u7684\u7269\u7406\u4f4d\u7f6e<br>log_errors=On \/\/\u8a18\u9304\u932f\u8aa4\u8a0a\u606f<br>error_reporting=&nbsp;&nbsp;&nbsp; \/\/\u986f\u793a\u932f\u8aa4\u5831\u544a,\u8a73\u7d30\u5ea6\u4f9d\u53c3\u6578\u6c7a\u5b9a,ex:E_ALL\u662f\u5168\u90e8\u932f\u8aa4\u7684\u5831\u544a<br>error_log=filename&nbsp; \/\/\u5132\u5b58\u932f\u8aa4\u8a0a\u606f<br>disable_functions = fun1,fun2&#8230;&nbsp; \/\/\u8981\u7981\u6b62\u7684\u51fd\u6578\uff0c\u591a\u500b\u51fd\u6578\u7528&#8221;,&#8221;\u9694\u958b<br>safe_mode=On&nbsp; \/\/\u5c0d\u5f88\u591a\u51fd\u6578\u9032\u884c\u4e86\u9650\u5236,\u5982\u57f7\u884c\u7cfb\u7d71\u547d\u4ee4\u7684\u51fd\u6578\uff0c\u80fd\u5728\u5f88\u5927\u7a0b\u5ea6\u89e3\u6c7aphp\u5b89\u5168<br>open_basedir=On &nbsp;&nbsp;&nbsp; \/\/\u6703\u4f7f\u6240\u6709\u88ab\u5b9a\u7fa9\u7684\u76ee\u9304\u53ca\u5176\u5b50\u76ee\u9304\u7684\u64cd\u4f5c\u53d7\u5230\u9650\u5236<br>allow_url_fopen=Off &nbsp;&nbsp;&nbsp; \/\/\u4e0d\u5141\u8a31\u628aURL\u4f4d\u7f6e\u7576\u4f5c\u6a94\u6848\u8655\u7406<br>register_globals=Off&nbsp;&nbsp;&nbsp; \/\/\u4e0d\u4f7f\u7528\u5168\u57df\u8b8a\u6578<\/p>\n","protected":false},"excerpt":{"rendered":"<p>php(http:\/\/www.php.net\/) &#038;#823 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[14],"tags":[],"class_list":["post-539","post","type-post","status-publish","format-standard","hentry","category-develop"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=539"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/539\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}