• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

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

php 搞代码 3年前 (2022-01-23) 18次浏览 已收录 0个评论

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

!本文来源gaodai.ma#com搞#代!码(网

搞gaodaima代码–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


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:php安装中出现的有关问题解决

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址