{"id":56,"date":"2006-08-24T20:26:15","date_gmt":"2006-08-24T12:26:15","guid":{"rendered":"http:\/\/218.246.69.8\/blog\/?p=56"},"modified":"2006-08-24T20:26:15","modified_gmt":"2006-08-24T12:26:15","slug":"mysqlapachephp%e7%9a%84%e4%b8%80%e4%ba%9b%e9%97%ae%e9%a2%98%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.liangliang.org.cn\/?p=56","title":{"rendered":"mysql+apache+php\u7684\u4e00\u4e9b\u95ee\u9898\u3002"},"content":{"rendered":"<p>MYSQL\uff1a<\/p>\n<p>shell&gt; groupadd mysql<br \/>\nshell&gt; useradd -g mysql mysql<br \/>\nshell&gt; cd \/usr\/local<br \/>\nshell&gt; gunzip &lt; \/PATH\/TO\/MYSQL-VERSION-OS.tar.gz | tar xvf -<br \/>\nshell&gt; ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql<br \/>\nshell&gt; cd mysql<br \/>\nshell&gt; scripts\/mysql_install_db --user=mysql<br \/>\nshell&gt; chown -R root .<br \/>\nshell&gt; chown -R mysql data<br \/>\nshell&gt; chgrp -R mysql .<br \/>\nshell&gt; bin\/mysqld_safe --user=mysql &amp;<\/p>\n<p>\u8bbe\u7f6e\u5bc6\u7801\uff1a<\/p>\n<p>shell&gt;bin\/mysqladmin -u root password 'newpassword'<\/p>\n<p>\u8fdb\u5165mysql:<\/p>\n<p>shell&gt;bin\/mysql -uroot -p<\/p>\n<p>Apache:<\/p>\n<p>.\/configure --prefix=\/opt\/apache --enable-track-vars --enable-cgi --with-config-file-path=\/opt\/apache\/conf<\/p>\n<p>--prefix=\/opt\/apache \u6307\u5b9a\u628aapahce\u5b89\u88c5\u5230\/opt\/apache\u76ee\u5f55\u4e2d\uff1b<br \/>\n--enable-cgi \u652f\u6301CGI\uff1b<br \/>\n--with-config-file-path=\/opt\/apache\/conf \u6307\u5b9a\u628aapache\u7684\u914d\u5236\u6587\u4ef6\u653e\u5728\/opt\/apache\/conf\u4e2d\uff1b\u6bd4\u5982httpd.conf\u914d\u5236\u6587\u4ef6\u5c31\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e2d\uff1b<\/p>\n<p>make<br \/>\nmake install<\/p>\n<p>\/opt\/apache\/bin\/apachectl start<\/p>\n<p>vi \/opt\/apache\/conf\/httpd.conf<\/p>\n<p>AddDefaultCharset ISO-8859-1<br \/>\n\u6ce8\uff1a\u8fd9\u53e5\u662f\u6307\u5b9a\u7f51\u9875\u7684\u9ed8\u8ba4\u8bed\u8a00\u7684,\u9ed8\u8ba4\u4e2d\u6587\u4e3a\"GB2312\"\u3002<\/p>\n<p>DirectoryIndex index.html index.html.var<br \/>\n\u6ce8\uff1a\u6dfb\u52a0\u7f51\u7ad9\u7684\u9ed8\u8ba4\u9875\u3002<\/p>\n<p>\u627e\u5230:<br \/>\n#AddType application\/x-tar .tgz<\/p>\n<p>\u52a0\u5165\uff1a<\/p>\n<p>AddType application\/x-httpd-php .php<\/p>\n<p>PHP\uff1a<\/p>\n<p>1. gunzip apache_xxx.tar.gz<br \/>\n2. tar -xvf apache_xxx.tar<br \/>\n3. gunzip php-xxx.tar.gz<br \/>\n4. tar -xvf php-xxx.tar<br \/>\n5. cd apache_xxx<br \/>\n6. .\/configure --prefix=\/www --enable-module=so<\/p>\n<p>\uff08.\/configure --prefix=\/usr\/local\/php --enable-fastcgi --enable-force-cgi-redirect --with-config-file-path=\/etc\/php --with-zlib --with-mysql=\/opt\/mysql --with-xml\uff09<\/p>\n<p>\uff08.\/configure --prefix=\/opt\/php --with-mysql=\/opt\/mysql --with-apxs2=\/opt\/apache\/bin\/apxs --enable-track-vars --enable-force-cgi-redirect --with-config-file-path=\/opt\/php\/etc\uff09<\/p>\n<p>--prefix=\/opt\/php \u6307\u5b9a\u628aphp\u5b89\u88c5\u5230\/opt\/php\u76ee\u5f55\u4e2d\uff1b<br \/>\n--with-mysql=\/opt\/mysql \u6307\u5b9amysql\u6570\u636e\u670d\u52a1\u5668\u5b89\u88c5\u7684\u4f4d\u7f6e\uff1b<br \/>\n--with-apxs2=\/opt\/apache\/bin\/apxs \u8fd9\u662f\u52a0\u5165apache\u4e2d\u4e3aDSO\u6a21\u5757\u7684\u4f4d\u7f6e\uff1b<br \/>\n-enable-track-vars \u4e3a\u542f\u52a8cookie\u7684get\/post\u7b49\u8ffd\u8e2a\u529f\u80fd<br \/>\n--with-config-file-path=\/opt\/php\/etc \u6307\u5b9aphp\u7684\u914d\u5236\u6587\u4ef6\u5b58\u653e\u7684\u76ee\u5f55\u662f\/opt\/php\/etc\u76ee\u5f55\uff0c\u6211\u4eec\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4e5f\u8981\u628aphp.ini\u590d\u5236\u5230\u8fd9\u4e2a\u76ee\u5f55\u4e2d\u6765\u3002<\/p>\n<p>7. make<br \/>\n8. make install<br \/>\n9. cd ..\/php-xxx<br \/>\n10. cp php.ini-dist \/usr\/local\/lib\/php.ini<br \/>\n(cp php.ini-dist \/etc\/php\/php.ini)<br \/>\n(cp php.ini-dist \/opt\/php\/etc\/php.ini)<br \/>\nvi \/opt\/php\/etc\/php.ini<br \/>\n\u627e\u5230:<br \/>\ndefault_charset = \"iso-8859-1\"<br \/>\n\u52a0\u4e00\u884c<br \/>\ndefault_charset = \"gb2312\"<\/p>\n<p>testphp<br \/>\nindex.php<br \/>\n<code>?&gt;?&gt;?&gt;\u00a0<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MYSQL\uff1a shell&gt; groupadd mysql shell&gt; useradd -g mysql mysql shell&gt; cd \/usr\/local shell&gt; g&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-56","post","type-post","status-publish","format-standard","hentry","category-xlamp"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.liangliang.org.cn\/index.php?rest_route=\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.liangliang.org.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.liangliang.org.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.liangliang.org.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.liangliang.org.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=56"}],"version-history":[{"count":0,"href":"https:\/\/www.liangliang.org.cn\/index.php?rest_route=\/wp\/v2\/posts\/56\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.liangliang.org.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.liangliang.org.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.liangliang.org.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}