本文目录一览:
- 1、php编译出错,哪有大神帮帮忙!!!
- 2、php编译后漏掉一些参数怎么办
- 3、linux服务器php编译安装成功之后,无法重新编译安装,怎么办?
- 4、php编译时没有加–enable-bcmath导致现在这个库里的函数不能用,如何给启用啊。
- 5、编译PHP提示出错找不到libc-client.无法编译PHP怎么办
php编译出错,哪有大神帮帮忙!!!
Class.forName(className) 实际上是调用Class.forName(className, true, this.getClass().getClassLoader())。注意第二个参数,是指Class被loading后是不是必须被初始化。 ClassLoader.loadClass(className)实际上调用的是ClassLoader.loadClass(name, false),第二个参数指出Class是否被link。 区别就出来了。Class.forName(className)装载的class已经被初始化,而ClassLoader.loadClass(className)装载的class还没有被link
php编译后漏掉一些参数怎么办
比如添加bcmath模块:(在编译时没有添加 –enable-bcmath)
# cd php-5.3.10/ext/bcmath
# /usr/local/php/bin/phpize
# ./configure –with-php-config=/usr/local/php/bin/php-config
# make make install
# cp /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/bcmath.so
/usr/lib/php/modules
# vi /usr/local/php/etc/php.ini
[bcmath]
extension=bcmath.so
:wq
重启apache:
# /usr/local/apache/bin/apachectl restart
linux服务器php编译安装成功之后,无法重新编译安装,怎么办?
具体看你缺少什么参数,一般的参数都可以通过配置文件修改的,文件路径一般再/etc/php.ini ,如果是是缺少依赖lib的话,可以单独编译库源码 成.so文件,添加依赖文件到 php.ini 重启就好了
php编译时没有加–enable-bcmath导致现在这个库里的函数不能用,如何给启用啊。
这个貌似要重新编译下的,把编译参数加进去。楼上是正解,具体过程我也忘记了,你搜下应该能搜到。
编译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
脚本取自
在/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}://{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
原创文章,作者:小蓝,如若转载,请注明出处:https://www.506064.com/n/154461.html