㈡ 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后有一些优化包根据需要安装