{"id":289,"date":"2013-03-16T00:13:04","date_gmt":"2013-03-15T16:13:04","guid":{"rendered":"http:\/\/www.shuran.cn\/?p=289"},"modified":"2013-09-23T16:25:06","modified_gmt":"2013-09-23T08:25:06","slug":"%e9%98%bf%e9%87%8c%e4%ba%91%e6%9c%8d%e5%8a%a1%e5%99%a8-%e5%ae%89%e8%a3%85-nginxphpmysql-%e7%ac%ac%e4%ba%8c%e6%ad%a5%e5%ae%89%e8%a3%85php%e5%92%8cmysql","status":"publish","type":"post","link":"https:\/\/www.shuran.cn\/?p=289","title":{"rendered":"\u963f\u91cc\u4e91\u670d\u52a1\u5668 \u5b89\u88c5 nginx+php+mysql\u2014\u2014\u2014-\u7b2c\u4e8c\u6b65\u5b89\u88c5php\u548cmysql"},"content":{"rendered":"<p><strong>\u6587\u672c\u5185\u5bb9\u5982\u4e0b\uff1a<\/strong><\/p>\n<p>\u914d\u7f6ephp<\/p>\n<p>\u6ca1\u6709\u5b89\u88c5mysql<br \/>\n.\/configure --prefix=\/mnt\/web\/php --with-config-file-path=\/mnt\/web\/php --with-openssl --with-zlib --with-curl --enable-gd-native-ttf --with-mysql --with-bz2 --with-gd --enable-mbstring --with-mcrypt --with-mysqli --enable-embedded-mysqli --enable-zip --enable-fpm --with-zlib --enable-mbstring --enable-sockets --with-png-dir --with-freetype-dir=\/usr\/include\/freetype2\/freetype\/ --with-iconv-dir --with-jpeg-dir --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization \u00a0--enable-mbregex --with-mhash --enable-pcntl \u00a0--with-xmlrpc \u00a0--enable-pdo --with-pdo-mysql --with-pdo-sqlite<\/p>\n<p>\u5df2\u7ecf\u5b89\u88c5\u4e86Mysql\u7684\u8bdd<br \/>\n.\/configure --prefix=\/mnt\/web\/php --with-config-file-path=\/mnt\/web\/php --with-openssl --with-zlib --with-curl --enable-gd-native-ttf --with-mysql=\/mnt\/web\/mysql --with-libxml --with-bz2 --with-gd --enable-mbstring --with-mcrypt --with-mysqli=\/mnt\/web\/mysql\/bin\/mysql_config --enable-embedded-mysqli --enable-zip --enable-fastcgi --enable-fpm --with-zlib --enable-mbstring --enable-pic --with-xml --enable-sockets --with-png-dir --with-freetype-dir=\/usr\/include\/freetype2\/freetype\/ --with-iconv-dir --with-jpeg-dir --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbregex --with-mhash --enable-pcntl --with-ldap-dir=\/usr\/lib64 --with-xmlrpc --with-gd<br \/>\nconfigure: error: xml2-config not found. Please check your libxml2 installation.<br \/>\nyum -y install libxml2<br \/>\nyum -y install libxml2-devel<\/p>\n<p>configure: error: Please reinstall the BZip2 distribution<br \/>\nwget http:\/\/www.bzip.org\/1.0.6\/bzip2-1.0.6.tar.gz<br \/>\ntar -zxvf bzip2-1.0.6.tar.gz<br \/>\ncd bzip2-1.0.6<br \/>\nmake<br \/>\nmake install<\/p>\n<p>configure: error: Please reinstall the libcurl distribution - easy.h should be in &lt;curl-dir&gt;\/include\/curl\/<br \/>\nwget http:\/\/curl.haxx.se\/download\/curl-7.29.0.tar.gz<br \/>\ntar -zxvf curl-7.29.0.tar.gz<br \/>\ncd curl-7.29.0<br \/>\n.\/configure<br \/>\nmake<br \/>\nmake install<\/p>\n<p>yum -y install libjpeg<br \/>\nyum -y install libpng<br \/>\nyum -y install freetype<br \/>\nyum install libpng-devel-1.2.49-1.el6_2.x86_64<br \/>\nyum install freetype-devel-2.3.11-14.el6_3.1.x86_64<br \/>\nyum install libjpeg-turbo-devel-1.2.1-1.el6.x86_64<br \/>\nyum install openldap<br \/>\nyum install openldap-clients<br \/>\nyum install openldap-devel<br \/>\nyum install openldap-servers<\/p>\n<p>configure: error: mcrypt.h not found. Please reinstall libmcrypt.<\/p>\n<p>wget ftp:\/\/mcrypt.hellug.gr\/pub\/crypto\/mcrypt\/libmcrypt\/libmcrypt-2.5.7.tar.gz<br \/>\ntar -zxvf libmcrypt-2.5.7.tar.gz<br \/>\ncd libmcrypt-2.5.7<br \/>\n.\/configure<br \/>\nmake<br \/>\nmake install<br \/>\nok\u914d\u7f6e\u901a\u8fc7<\/p>\n<p>make<br \/>\nmake install<\/p>\n<p>\u590d\u5236php.ini\u5230php\u5b89\u88c5\u76ee\u5f55<br \/>\ncp php.ini-production \/mnt\/web\/php\/php.ini<br \/>\n\u7cfb\u7edf\u5e26\u6709\u7cfb\u7edf\u670d\u52a1\u6ce8\u518c\u6587\u4ef6<br \/>\ncp sapi\/fpm\/init.d.php-fpm \/etc\/init.d\/php-fpm<\/p>\n<p>chmod +x \/etc\/init.d\/php-fpm<\/p>\n<p>chkconfig --add php-fpm<\/p>\n<p>chkconfig --level 2345 php-fpm on<br \/>\n\u3001\u3001\u3001\u3001<br \/>\nWrote PEAR system config file at: \/mnt\/web\/php\/etc\/pear.conf<br \/>\nYou may want to add: \/mnt\/web\/php\/lib\/php to your php.ini include_path<br \/>\n\/mnt\/tmp\/php-5.4.13\/build\/shtool install -c ext\/phar\/phar.phar \/mnt\/web\/php\/bin<br \/>\nln -s -f \/mnt\/web\/php\/bin\/phar.phar \/mnt\/web\/php\/bin\/phar<br \/>\nInstalling PDO headers: \/mnt\/web\/php\/include\/php\/ext\/pdo\/<\/p>\n<p>\u3001\u3001\u3001\u3001<br \/>\nMYsql<br \/>\n\u65b0\u7248\u672c\u7684MYsql \u4f7f\u7528cmake\u6765\u7f16\u8bd1<br \/>\nwget http:\/\/www.cmake.org\/files\/v2.8\/cmake-2.8.10.2.tar.gz<br \/>\ncd cmake-2.8.10.2.tar.gz<br \/>\ncd cmake-2.8.10.2<br \/>\n.\/configure<br \/>\nmake<br \/>\nmake install<\/p>\n<p>wget http:\/\/www.mysql.com\/get\/Downloads\/MySQL-5.6\/mysql-5.6.10.tar.gz\/from\/http:\/\/cdn.mysql.com\/<\/p>\n<p>tar -zxvf mysql-5.6.10.tar.gz<br \/>\ncd mysql-5.6.10<\/p>\n<p>cmake -DCMAKE_INSTALL_PREFIX=\/mnt\/web\/mysql -DMYSQL_DATADIR=\/mnt\/web\/mysql\/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1 -DMYSQL_UNIX_ADDR=\/tmp\/mysqld.sock<\/p>\n<p>\u62a5\u9519\u3002 remove CMakeCache.txt and rerun cmake.On Debian\/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.<\/p>\n<p>yum -y install ncurses-devel<br \/>\nrm -f CMakeCache.txt<br \/>\n\u91cd\u65b0cmake<br \/>\n\u7136\u540emake<br \/>\nmake install<\/p>\n<p>\u914d\u7f6emysql\u7cfb\u7edf\u81ea\u52a8\u542f\u52a8<\/p>\n<p>cp \/mnt\/web\/mysql\/support-files\/mysql.server \/etc\/init.d\/mysql<br \/>\nchmod +x \/etc\/init.d\/mysql<\/p>\n<p>chkconfig --add mysql<\/p>\n<p>chkconfig --level 2345 mysql on<\/p>\n<p>\u5efa\u7acbuser\u548cgroup\uff0c\u6267\u884c\u914d\u7f6e\u811a\u672c<\/p>\n<p>groupadd mysql<\/p>\n<p>useradd -g mysql mysql<\/p>\n<p>chown mysql:mysql \/mnt\/web\/mysql\/data<\/p>\n<p>chmod 755 \u00a0\/mnt\/web\/mysql\/data<\/p>\n<p>.\/mysql_install_db --user=mysql --basedir=\/mnt\/web\/mysql --datadir=\/mnt\/web\/mysql\/data<\/p>\n<p>service mysql start<\/p>\n<p>\u4fee\u6539mysql\u767b\u9646\u5bc6\u7801\u548c\u8fdc\u7a0b\u8fde\u63a5<\/p>\n<p>\/mnt\/web\/mysql\/bin\/mysql -u root mysql<\/p>\n<p>mysql&gt;use mysql;<br \/>\nmysql&gt;desc user;<br \/>\nmysql&gt; GRANT ALL PRIVILEGES ON *.* TO root@\"%\" IDENTIFIED BY \"root\";\u3000\u3000\/\/\u4e3aroot\u6dfb\u52a0\u8fdc\u7a0b\u8fde\u63a5\u7684\u80fd\u529b\u3002<br \/>\nmysql&gt;update user set Password = password('xxxxxx') where User='root';<br \/>\nmysql&gt;select Host,User,Password from user where User='root';<br \/>\nmysql&gt;flush privileges;<br \/>\nmysql&gt;exit<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u672c\u5185\u5bb9\u5982\u4e0b\uff1a \u914d\u7f6ephp \u6ca1\u6709\u5b89\u88c5mysql .\/configure --prefix=\/mnt\/web\/p\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.shuran.cn\/?p=289\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-289","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=289"}],"version-history":[{"count":5,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/289\/revisions"}],"predecessor-version":[{"id":402,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/289\/revisions\/402"}],"wp:attachment":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}