1.下載源碼
2.更新所需組件
3.解壓
4.編譯
5.配置
6.啟動
7.應用
wget http://download.niexin.me/php/linux/php-7.1.5.tar.gz
yum -y install libxml2-devel libxml2 gcc libcurl libcurl-devel openssl openssl-devel libpng libpng-devel freetype freetype-devel libxslt libxslt-devel libjpeg libjpeg-devel libxml2 libxml2-devel pcre-devel
tar -zxvf php-7.1.5.tar.gz
cd php-7.1.5/
./configure \--prefix=/usr/local/php \--with-curl \--with-freetype-dir \--with-gd \--with-gettext \--with-iconv-dir \--with-kerberos \--with-libdir=lib64 \--with-libxml-dir \--with-mysqli \--with-openssl \--with-pcre-regex \--with-pdo-mysql \--with-pdo-sqlite \--with-pear \--with-png-dir \--with-xmlrpc \--with-xsl \--with-zlib \--enable-fpm \--enable-bcmath \--enable-libxml \--enable-inline-optimization \--enable-gd-native-ttf \--enable-mbregex \--enable-mbstring \--enable-opcache \--enable-pcntl \--enable-shmop \--enable-soap \--enable-sockets \--enable-sysvsem \--enable-xml \--enable-zip
make && make install
還是在php-7.1.5/目錄下
#?cp php.ini-development /usr/local/php/lib/php.ini
# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
# cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
# cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm
/etc/init.d/php-fpm
開機啟動:
vim /etc/rc.local
新增一行,寫入/etc/init.d/php-fpm>dev/null 2>&1
# vim /etc/nginx/nginx.conf
在server節點中添加以下內容
location ~ \.php$ { root /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
最后重啟nginx:systemctl restart nginx
分享文章:centos7編譯安裝PHP7,并配置nginx
地址分享:http://m.newbst.com/article2/spoc.html
成都網站建設公司_創新互聯,為您提供App開發、動態網站、虛擬主機、外貿網站建設、網站制作、品牌網站建設
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯