編譯安裝PHP

2021-08-19 13:14:13 字數 1505 閱讀 9786

編譯安裝php

#安裝依賴

yum install gcc bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel libxml2-devel libcurl-devel bzip2-devel readline-devel libedit-devel sqlite-devel jemalloc jemalloc-devel

#進入解壓後的php原始碼目錄下

#編譯命令,執行後在原始碼目錄的父目錄下生成編譯後的子目錄

./configure --prefix=/ \

--with-config-file-path=/ \

--enable-inline-optimization \

--disable-debug \

--disable-rpath \

--enable-shared \

--enable-opcache \

--enable-fpm \

--with-mysqli \

--with-pdo-mysql \

--with-gettext \

--enable-mbstring \

--with-iconv \

--with-mcrypt \

--with-mhash \

--with-openssl \

--enable-bcmath \

--enable-soap \

--with-libxml-dir \

--enable-pcntl \

--enable-shmop \

--enable-sysvmsg \

--enable-sysvsem \

--enable-sysvshm \

--enable-sockets \

--with-curl \

--with-zlib \

--enable-zip \

--with-bz2 \

--with-gd \

--with-freetype-dir \

--with-jpeg-dir \

--with-png-dir

##如果出現 libpng not found

yum install libpng

yum -y install libpng-devel

##如果出現 libjpeg not found

yum install libjpeg

yum -y install libjpeg-devel

##如果出現 freetype-config not found.

yum -y install freetype-devel.x86_64

#清理編譯

make clean

#編譯安裝

make && make install

#或 make all install

PHP 編譯安裝PHP

1.安裝php所有的依賴軟體包 root web01 yum install zlib devel libxml2 devel libjpeg devel freetype devel libpng devel gd devel libcurl devel libxslt devel openssl...

PHP編譯安裝

錯誤1configure error xml2 config not found.please check your libxml2 installation.解決方案 yum install y libxml2 devel錯誤2 configure error cannot find openss...

編譯安裝PHP

2 確保安裝之前有安裝gd,png,curl,xml等等lib開發庫。如果不確定,執行以下命令 yum install gcc make gd devel libjpeg devel libpng devel libxml2 devel bzip2 devel libcurl devel y 3 編...