{"id":444,"date":"2023-02-25T13:07:46","date_gmt":"2023-02-25T05:07:46","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=444"},"modified":"2023-04-29T21:03:04","modified_gmt":"2023-04-29T13:03:04","slug":"install-and-config-php-7-under-centos","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/25\/install-and-config-php-7-under-centos\/","title":{"rendered":"CentOS\u4e0b\u5b89\u88c5\u914d\u7f6ePHP 7"},"content":{"rendered":"<h2>\u5b89\u88c5\u7f16\u8bd1\u73af\u5883<\/h2>\n<pre><code class=\"language-shell\"># yum install wget gcc gcc-c++ g++ autoconf autoconf2.13 automake make m4<\/code><\/pre>\n<p><!-- more --><\/p>\n<h2>\u5b89\u88c5\u914d\u7f6ePHP<\/h2>\n<pre><code class=\"language-shell\"># yum install openssl openssl-devel python-devel libxml2 libxml2-devel zlib-devel pcre-devel libcurl-devel libjpeg-devel libpng-devel libpng12-devel freetype-devel mhash-devel libmcrypt-devel libXpm-devel libedit-devel re2c libxslt libxslt-devel libicu-devel\n\n# wget http:\/\/php.net\/distributions\/php-7.1.16.tar.gz\n# tar -zxf php-7.1.16.tar.gz\n# cd php-7.1.16\n# .\/configure --prefix=\/data\/server\/php7 \\\n--with-config-file-path=\/data\/server\/php7\/etc \\\n--enable-fpm \\\n--with-fpm-user=www \\\n--with-fpm-group=www \\\n--enable-bcmath \\\n--with-pdo_sqlite \\\n--with-gettext \\\n--with-iconv \\\n--enable-ftp \\\n--with-sqlite3 \\\n--enable-xml \\\n--enable-mbstring \\\n--enable-sockets \\\n--enable-zip \\\n--enable-soap \\\n--enable-fileinfo \\\n--enable-exif \\\n--with-readline \\\n--with-libedit \\\n--with-openssl \\\n--with-zlib \\\n--with-curl \\\n--with-gd \\\n--with-jpeg-dir \\\n--with-png-dir \\\n--with-freetype-dir \\\n--with-libxml-dir \\\n--with-xpm-dir \\\n--with-mcrypt \\\n--with-mhash \\\n--enable-mysqlnd \\\n--enable-pdo \\\n--with-mysqli \\\n--with-pdo-mysql \\\n--without-pear \\\n--with-libdir=lib64 \\\n--with-mysql-sock \\\n--enable-opcache \\\n--enable-fastcgi \\\n--enable-intl \\\n--with-xsl \\\n--disable-cgi\n# make\n# 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 \/data\/server\/php7\/bin\/* \/usr\/bin\/\n# ln -s \/data\/server\/php7\/sbin\/* \/usr\/bin\/\n# php -v<\/code><\/pre>\n<h2>el6(CentOS 6)\u624b\u52a8\u5b89\u88c5\u4f9d\u8d56<\/h2>\n<p>libicu-devel: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/pkgs.org\/download\/libicu-devel\">https:\/\/pkgs.org\/download\/libicu-devel<\/a><\/p>\n<pre><code># rpm -ivh libicu-devel-4.2.1-14.el6.x86_64.rpm<\/code><\/pre>\n<p>libmcrypt: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/pkgs.org\/download\/libmcrypt\">https:\/\/pkgs.org\/download\/libmcrypt<\/a><\/p>\n<pre><code># rpm -ivh libmcrypt-2.5.8-9.el6.x86_64.rpm<\/code><\/pre>\n<p>libmcrypt-devel: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/pkgs.org\/download\/libmcrypt-devel\">https:\/\/pkgs.org\/download\/libmcrypt-devel<\/a><\/p>\n<pre><code># rpm -ivh libmcrypt-devel-2.5.8-9.el6.x86_64.rpm<\/code><\/pre>\n<p>libedit-devel: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/pkgs.org\/download\/libedit-devel\">https:\/\/pkgs.org\/download\/libedit-devel<\/a><\/p>\n<pre><code># yum install ncurses-devel\n# rpm -ivh libedit-devel-2.11-4.20080712cvs.1.el6.x86_64.rpm<\/code><\/pre>\n<p>\u56fd\u5185\u955c\u50cf<\/p>\n<p><a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/mirrors.ustc.edu.cn\/epel\/6\/x86_64\/Packages\/l\/\">http:\/\/mirrors.ustc.edu.cn\/epel\/6\/x86_64\/Packages\/l\/<\/a><br \/>\n<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/mirrors.hust.edu.cn\/epel\/6\/x86_64\/Packages\/l\/\">http:\/\/mirrors.hust.edu.cn\/epel\/6\/x86_64\/Packages\/l\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5\u7f16\u8bd1\u73af\u5883 # yum install wget gcc gcc-c++ g++ autoconf auto [&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":[47],"class_list":["post-444","post","type-post","status-publish","format-standard","hentry","category-devops-base","tag-php"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/444","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=444"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/444\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}