{"id":71,"date":"2023-02-12T21:23:29","date_gmt":"2023-02-12T13:23:29","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=71"},"modified":"2023-02-12T21:23:50","modified_gmt":"2023-02-12T13:23:50","slug":"centos-install-nginx-php","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/12\/centos-install-nginx-php\/","title":{"rendered":"CentOS\u4e0bNginx\u53caPHP\u5feb\u901f\u5b89\u88c5"},"content":{"rendered":"<h2>Nginx<\/h2>\n<pre><code class=\"language-bash\"># wget http:\/\/nginx.org\/download\/nginx-1.17.2.tar.gz\n# tar -zxf nginx-1.17.2.tar.gz \n# cd nginx-1.17.2\/\n# .\/configure --prefix=\/usr\/local\/nginx --with-pcre=..\/pcre-8.43 --with-openssl=..\/openssl-1.1.1c --with-zlib=..\/zlib-1.2.11 --with-http_ssl_module --with-http_v2_module  \n# make &amp; make install\n# ln -s \/usr\/local\/nginx\/sbin\/nginx \/usr\/sbin\/\n# nginx -v<\/code><\/pre>\n<blockquote>\n<p>\u5fc5\u987b\u4e3apcre\uff0c\u4e0d\u80fd\u4e3apcre2<br \/>\npcre\u3001openssl\u3001zlib\u9700\u8981\u6307\u5b9a\u6e90\u7801\u76ee\u5f55\uff0c\u4e0d\u80fd\u662f\u5df2\u7f16\u8bd1\u5b89\u88c5\u7684\u76ee\u5f55<\/p>\n<\/blockquote>\n<h2>PHP<\/h2>\n<h3>PHP\u7f16\u8bd1\u5b89\u88c5<\/h3>\n<pre><code class=\"language-bash\"># wget https:\/\/www.php.net\/distributions\/php-7.2.20.tar.gz\n# tar -zxf php-7.2.20.tar.gz\n# cd php-7.2.20\/\n# .\/configure --prefix=\/usr\/local\/php --with-config-file-path=\/usr\/local\/php\/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir=\/usr\/local\/libiconv --with-freetype-dir=\/usr\/local\/freetype --with-jpeg-dir=\/usr\/local\/jpeg-9c --with-png-dir=\/usr\/local\/libpng --with-zlib=\/usr\/local\/zlib --with-libxml-dir=\/usr\/local\/libxml2 --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl=\/usr\/local\/curl  --enable-mbregex --enable-mbstring --with-mcrypt=\/usr\/local\/libmcrypt --enable-ftp --with-gd=\/usr\/local\/libgd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --with-ldap=\/usr --disable-fileinfo --enable-maintainer-zts --with-libzip=\/usr\/local\/libzip\n# make &amp;&amp; make install\n# cd \/data\/server\/php7\/etc\/\n# cp php-fpm.conf.default php-fpm.conf\n# cp php-fpm.d\/www.conf.default php-fpm.d\/www.conf\n# ln -s \/usr\/local\/php\/bin\/* \/usr\/bin\/\n# ln -s \/usr\/local\/php\/sbin\/* \/usr\/sbin\/\n# php -v\n# php-fpm<\/code><\/pre>\n<blockquote>\n<p>\u6ce8\u610fconfigure\u4e4b\u524d\u6dfb\u52a0\u4f9d\u8d56\u5e93\u641c\u7d22\u8def\u5f84\u5230\u914d\u7f6e\u6587\u4ef6<\/p>\n<\/blockquote>\n<pre><code class=\"language-bash\"># vim \/etc\/ld.so.conf.d\/local.conf\n# ldconfig<\/code><\/pre>\n<pre><code class=\"language-bash\">\/usr\/local\/lib64\n\/usr\/local\/lib\n\/usr\/lib64\n\/usr\/lib\n\/usr\/local\/zlib\/lib\n\/usr\/local\/libzip\/lib\n\/usr\/local\/libgd\/lib\n\/usr\/local\/libevent\/lib\n\/usr\/local\/libmcrypt\/lib\n\/usr\/local\/freetype\/lib\n\/usr\/local\/mysql\/lib\n\/usr\/local\/net-snmp\/lib<\/code><\/pre>\n<h3>\u5e38\u89c1\u9519\u8bef<\/h3>\n<p>\uff081\uff09liblber<\/p>\n<pre><code class=\"language-bash\">\/bin\/ld: ext\/ldap\/.libs\/ldap.o: undefined reference to symbol &#039;ber_scanf&#039;\n\/usr\/lib64\/liblber-2.4.so.2: error adding symbols: DSO missing from command line\ncollect2: error: ld returned 1 exit status\nmake: *** [sapi\/cli\/php] Error 1<\/code><\/pre>\n<p>\u89e3\u51b3\uff1a\u5728PHP\u6e90\u7801\u76ee\u5f55\u4e0b<code>vim Makefile<\/code>\u627e\u5230<code>EXTRA_LIBS<\/code>\u884c\uff0c\u5728\u884c\u672b\u6dfb\u52a0<code>-llber<\/code>\u4fdd\u5b58\u9000\u51fa\u518d\u6b21make\u5373\u53ef<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nginx # wget http:\/\/nginx.org\/download\/nginx-1.17.2.tar [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[25,47],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-devops-base","tag-nginx","tag-php"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}