㈡ PHP7.2 安裝openssl擴展報錯問題。(centos7.7)
試試重新安裝看可行
刪除舊版本:yum remove -y openssl openssl-devel 源碼安裝openssl需要perl環境編譯,如果沒有perl環境還是需要安裝:yum -y install perl perl-devel
1.下載源碼包
wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz
2.解壓源碼包並進入解壓後的目錄:
tar zxf openssl-1.0.2l.tar.gz
cd openssl-1.0.2l
3.配置並編譯安裝:
./config -fPIC --prefix=/usr/local/openssl/ enable-shared && make && make install
注釋:
--prefix:指定安裝目錄
-fPIC:編譯openssl的靜態庫
enable-shared:編譯動態庫
4.加入環境變數,以便方便使用openssl命令:
echo "export PATH=$PATH:/usr/local/openssl/bin" >>/etc/profile
source /etc/profile
5.將庫文件路徑寫入/etc/ld.so.conf文件中,方便調用庫文件
echo "include /usr/local/openssl2/lib" >> /etc/ld.so.conf
ldconfig
6.查看openssl命令路徑:
which openssl
/usr/local/openssl/bin/openssl
查看版本號:
openssl version -a
㈢ php 7.3 /usr/bin/ld: cannot find -liconv 編譯一直報這個錯.vim Makefile 也添加過-liconv還是報錯
首先,你要檢查系統是否安裝了libiconv,數喊沒如果已安裝了最新版本,此步忽略;
第二,如果還是報錯,可能libiconv.so庫文件找不到引起的,編譯php時,使用如下薯納命令:
1、滲羨sh> make ZEND_EXTRA_LIBS='-liconv'
2、修改配置:
sh> cat /etc/ld.so.conf
sh> include ld.so.conf.d/*.conf
sh> echo "/usr/local/lib" >> /etc/ld.so.conf
sh> ldconfig
3、sh> make install
㈣ 編譯安裝PHP7.2.3報錯
只是提示你PEAR配置文件位置,應該是安裝成功了你試試
/usr/local/php/bin/php-v
㈤ 編譯PHP提示出錯找不到libc-client.無法編譯PHP怎麼辦
I. 安裝devel庫
yum install pam-devel libc-client libc-client-devel -y
如果使用了yum安裝了libc-client,那麼在以後編譯參數--with-imap=/usr/local/php-imap中的路徑應該刪除,即--with-imap。
如果這樣還不能解決,那麼就需要手動編譯imap2007f了!
II. 手動編譯imap2007f
腳本取自 http://forum.directadmin.com/showthread.php?t=45434
在/usr/src目錄下運行以下腳本,將會在/usr/local/php-imap目錄下生成imap需要的庫
#!/bin/sh
# Script for PHP-IMAP installation. 0.1b
# Written by Martynas Bendorius (smtalk)
CWD=`pwd`
OS=`uname`
#Is it a 64-bit OS?
B64=0
B64COUNT=`uname -m | grep -c 64`
if [ "$B64COUNT" -eq 1 ]; then
B64=1
LD_LIBRARY_PATH=/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
fi
if [ ! -e /usr/include/krb5.h ] && [ -e /etc/redhat-release ]; then
echo "Installing krb5-devel"
yum -y install krb5-devel
fi
VERSION=2007f
PROTOCOL=ftp
URL="${PROTOCOL}://ftp.cac.washington.e/imap/imap-${VERSION}.tar.Z"
FILENAME=imap-${VERSION}
TARBALL=${FILENAME}.tar.Z
echo "Downloading ${TARBALL}..."
wget -O ${TARBALL} ${URL}
tar xzf ${TARBALL}
cd ${FILENAME}
echo "Installing ${FILENAME}..."
if [ ${OS} = "FreeBSD" ]; then
if [ ${B64} -eq 0 ]; then
make bsf
else
make bsf EXTRACFLAGS=-fPIC
fi
else
perl -pi -e 's#SSLDIR=/usr/local/ssl#SSLDIR=/etc/pki/tls#' src/osdep/unix/Makefile
perl -pi -e 's#SSLINCLUDE=\$\(SSLDIR\)/include#SSLINCLUDE=/usr/include/openssl#' src/osdep/unix/Makefile
perl -pi -e 's#SSLLIB=\$\(SSLDIR\)/lib#SSLLIB=/usr/lib/openssl#' src/osdep/unix/Makefile
if [ ${B64} -eq 0 ]; then
make slx
else
make slx EXTRACFLAGS=-fPIC
fi
fi
echo "Copying files to /usr/local/php-imap"
mkdir -p /usr/local/php-imap/include
mkdir -p /usr/local/php-imap/lib
chmod -R 077 /usr/local/php-imap
cp -f c-client/*.h /usr/local/php-imap/include/
cp -f c-client/*.c /usr/local/php-imap/lib/
cp -f c-client/c-client.a /usr/local/php-imap/lib/libc-client.a
cd ..
rm -rf ${FILENAME}
if [ -d /usr/lib/x86_64-linux-gnu ] && [ ! -d /usr/kerberos/lib ]; then
mkdir -p /usr/kerberos
ln -s /usr/lib/x86_64-linux-gnu /usr/kerberos/lib
fi
exit 0;
III. 開始編譯
下面是編譯PHP的參數,如果出現問題,請參考編譯PHP5.6 和 PHP編譯錯誤的解決辦法。
./configure --prefix=/usr/local/php --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --enable-ftp --with-imap=/usr/local/php-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --disable-fileinfo
IV. 其他問題
在本次編譯中,老高又遇到了幾個怪事
set --enable-opcache=no
configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no
這個問題還是庫文件的鏈接問題
解決:
echo /usr/local/lib > /etc/ld.so.conf.d/local.conf
ldconfig -v
讓編譯的PHP支持memcache
㈥ 求助,Linux系統安裝php,報錯!
請用 ./configure 還有就是你那一堆換行連接符 有問題 ,./configure 是autoconf 生成的一個對應不同的環境進行配置的一個shell 文件,如果你還是報錯,那麼檢查你後面with的那一堆php擴展的依賴,一般你with 那麼多是安裝不過的 。
㈦ centos7編譯php出現問題 系統:CENTOS7 64位 PHP版本:7.1.0 APACHE版本:2.4.25 MYSQL版
1、php的編譯問題主要是依賴包沒有提前安裝
2、如果依賴mysql,就先安裝mysql-devel或編譯mysql
3、需要提前安裝的有,不能寫太細,太細會被度娘屏蔽:
yasm-1.3.0.tar.gz
libmcrypt-2.5.8.tar.gz
libvpx-v1.3.0.tar.bz2
tiff-4.0.3.tar.gz
libpng-1.6.16.tar
freetype-2.5.4.tar.gz
jpegsrc.v9a.tar.gz
libgd-2.2.3.tar.gz
t1lib-5.1.2.tar.gz
4、安裝編譯php
5、安裝php後有一些優化包根據需要安裝