centos8編譯安裝php8


2021年4月24日17:29:22

環境: php8.0.3 centos 8.3

./configure \
--prefix=/usr/local/php8 \
--with-config-file-path=/usr/local/php8/etc \
--with-curl \
--with-freetype \
--enable-gd \
--with-jpeg \
--with-gettext \
--with-kerberos \
--with-libdir=lib64 \
--with-libxml \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-pdo-sqlite \
--with-pear \
--enable-sockets \
--with-mhash \
--with-ldap-sasl \
--with-xsl \
--with-zlib \
--with-zip \
-with-bz2 \
--with-iconv \
--enable-fpm \
--enable-pdo \
--enable-bcmath \
--enable-mbregex \
--enable-mbstring \
--enable-opcache \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvsem \
--enable-xml \
--enable-cli \
--enable-opcache \
--enable-intl \
--enable-calendar \
--enable-static \
--enable-mysqlnd \
--with-fpm-user=www \
--with-fpm-group=www 

注意:一些錯誤的處理

一般遇到  Package 'XXXX', required by 'virtual:world', not found)

多數情況下可以

Package 'libxml-2.0', required by 'virtual:world', not found
這樣的錯誤都可以執行
yum search libxml2-devel
如果有,就是直接
yum install libxml2-devel

Package 'oniguruma', required by 'virtual:world', not found)

wget https://github.com/kkos/oniguruma/archive/v6.9.4.tar.gz -O oniguruma-6.9.4.tar.gz 
tar xf oniguruma-6.9.4.tar.gz 
cd oniguruma-6.9.4/
./autogen.sh && ./configure --prefix=/usr
make && make install
cp php.ini-production /usr/local/php8/etc/php.ini

cd /usr/local/php8/etc/php-fpm.d/
cp www.conf.default www.conf

cd /usr/local/php8/etc/
cp php-fpm.conf.default php-fpm.conf

注意指定pid和socket的時候,主要吧文件配置到對應的php8目錄下,因為很可能線上是多版本兼容的


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM