Linux源碼編譯安裝php7.3

---恢復內容開始---php

ps:一切從簡mysql

1、安裝所需環境nginx

yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libzip-devel pcre-devel

2、下載及安裝nginxsql

1.下載phpapi

wget http://cn2.php.net/distributions/php-7.3.3.tar.gzsession

 2.解壓phpphp7

tar -xzf php-7.3.3.tar.gzcurl

3.進入php目錄socket

cd php-7.3.3php-fpm

3.編譯php(咱們不提供apxs參數,相反,咱們提供php-fpm相關參數)

./configure --prefix=/usr/local/php7 \ --with-config-file-path=/usr/local/php7/etc \ --with-config-file-scan-dir=/usr/local/php7/etc/php.d \ --with-mcrypt=/usr/include \ --enable-mysqlnd \ --with-mysqli \ --with-pdo-mysql \ --enable-fpm \ --with-fpm-user=nginx \ --with-fpm-group=nginx \ --with-gd \ --with-iconv \ --with-zlib \ --enable-xml \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --enable-mbregex \ --enable-mbstring \ --enable-ftp \ --enable-gd-native-ttf \ --with-openssl \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --enable-soap \ --without-pear \ --with-gettext \ --enable-session \ --with-curl \ --with-jpeg-dir \ --with-freetype-dir \ --enable-opcache

-----------------------start---------------------------

  假如編譯完成以後報錯:

  「checking for libzip... configure: error: system libzip must be upgraded to v」

  執行一下,沒有報錯則忽略。

wget https://nih.at/libzip/libzip-1.2.0.tar.gz

tar -xzf libzip-1.2.0.tar.gz

./configure

make && make install

----------------------------end-------------------------

出現如下則表示編譯成功

+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+

Thank you for using PHP.

而後執行:

make test(若是出現什麼問題請谷歌或百度,或者往下看看能解決不)

--------------start----------------

若是這裏報錯:

/usr/local/include/zip.h:59:21: fatal error: zipconf.h: No such file or directory

則執行一下命令,沒有則忽略。

find / -name zipconf.h

cp /你zipconf.h所在的目錄  //usr/local/include/zipconf.h

而後從新 configure 成功以後在make test,沒問題則繼續執行後面的命令。

---------------end--------------------

make && make install -j2

3、配置php

1.複製ini文件

 cp php.ini-production /usr/local/php7/etc/php.ini

 

2.配置fpm

cd /usr/src/php-7.0.0/sapi/fpm

cp init.d.php-fpm /etc/init.d/php-fpm

chmod +x /etc/init.d/php-fpm

chkconfig --add php-fpm

chkconfig php-fpm on

相關文章
相關標籤/搜索