本文目錄一覽:
- 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/zh-tw/n/154461.html