>백엔드 개발 >PHP 튜토리얼 >php安装中出现的有关问题解决

php安装中出现的有关问题解决

WBOY
WBOY원래의
2016-06-13 10:30:16765검색

php安装中出现的问题解决
php安装:

1./configure --prefix=/usr/local/php --with-apxs2=/home/apache/bin/apxs --with-zlib-dir --with-libxml-dir=/usr/local/libxml2/ --with-gd --with-freetype --with-jpeg --with-png --enable-mbstring --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-gd-native-ttf --with-gettext=/usr/local/gettext/ --enable-magic-quotes --enable-sockets

需要php支持图片需要gd库

由于操作系统自带了gd png jpeg 库等,没法指定dir 直接用--with-jpeg这样的形式。

2.make install时出现以下错误:            

Installing PHP SAPI module:        apache2handler
/usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1.0/build/libtool' libphp5.la /usr/lib/apache2/modules
/usr/share/apr-1.0/build/libtool --mode=install cp libphp5.la /usr/lib/apache2/modules/
libtool: install: cp .libs/libphp5.so /usr/lib/apache2/modules/libphp5.so
libtool: install: cp .libs/libphp5.lai /usr/lib/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /home/hcc/php-5.2.13/libs'
chmod 644 /usr/lib/apache2/modules/libphp5.so
apxs:Error: Activation failed for custom /etc/apache2/httpd.conf file..
apxs:Error: At least one `LoadModule' directive already has to exist..
make: *** [install-sapi] Error 1

实际上httpd.conf已经存在。不知道为什么出现以上错误,采用了以下方法,先备份httpd.conf

然后重新建一个httpd.conf

内容

#LoadModule directive to aid module installations
#LoadModule dummy_module /usr/lib/apache2/modules/mod_dummy.so

这样就成功安装

3.解决了php安装后,发现php不支持jpeg,但是在上述的配置过程中已经加上了--with-jpeg,并且libjpeg的rpm也是安装的,但是始终是无法支持,只好重新安装jpeg库

下载jpegv6

ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/jpeg-6b.tar.gz

编译安装:./configure --prefix=/usr/local/jpeg --enable-shared

然后在安装php

/configure --prefix=/usr/local/php --with-apxs2=/home/apache/bin/apxs --with-zlib-dir --with-libxml-dir=/usr/local/libxml2/ --with-gd --with-freetype --with-jpeg-dir=/usr/local/jpeg --with-png --enable-mbstring --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-gd-native-ttf --with-gettext=/usr/local/gettext/ --enable-magic-quotes --enable-sockets

重新编译安装即可支持jpeg

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
이전 기사:php创办文件다음 기사:php简略验证码