700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > linux php验证码无法显示 PHPCMS在Linux下后台验证码无法显示的解决方法

linux php验证码无法显示 PHPCMS在Linux下后台验证码无法显示的解决方法

时间:2022-11-10 00:18:01

相关推荐

linux php验证码无法显示 PHPCMS在Linux下后台验证码无法显示的解决方法

烈火网()教程 PHPCMS在Linux下后台验证码无法显示。

网站环境如下:

Linux CentOS,

php5.2.10,

apache 2.2.11

Zend Opt3.3.3

这个问题苦恼了很久 ,终于解决了 ,本着OpenSource的精神,在这里总结一下。方便大家 。

如题所述,在Linux下安装完之后,登录后台。在后台登录界面里无法显示验证码,因为同样的phpcms版本在Windows下安装正常,所以不怀疑phpcms安装程序的事情。

把怀疑重点放在Linux系统配置上。

gd库已经安装,而且在phpcms的“安装环境检测”画面里,也已经检测到gd库。

但是,就是无法生成验证图片。

打开checkcode.php 发现生成的是.jpg格式的文件。

查看phpinfo(),发现并没有显示支持jpg格式。

难道是gd放弃了jpg?

于是从,下载 jpegsrc.v6b.tar.gz和 freetype-2.3.7.tar.gz文件。

安装:

Checking jpeg library

[root@www download]# rpm -qa | grep jpeg

libjpeg-devel-6b-43.fc10.i386

libjpeg-6b-43.fc10.i386

Install jpeg library

[root@www download]# tar -zxvf jpegsrc.v6b.tar.gz

[root@www download]# cd jpeg-6b

[root@www jpeg-6b]# ./configure --prefix=/usr/local/jpeg --with-freetype=/usr/local/freetype --enable-shared --enable-static

[root@www jpeg-6b]# make

[root@www jpeg-6b]# make intall

Checking freetype library

[root@www download]# rpm -qa | grep freetype

freetype-2.3.7-1.fc10.i386

freetype-devel-2.3.7-1.fc10.i386

Install freetype library

[root@www download]# tar -zxvf freetype-2.3.7.tar.gz

[root@www download]# cd freetype-2.3.7

[root@www freetype-2.3.7]# ./configure --prefix=/usr/local/freetype --enable-shared --enable-static

[root@www freetype-2.3.7]# make

[root@www freetype-2.3.7]# make intall

好了,现在开始安装php-5.2.10了.

先进入php源码目录.

#./configure --with-mysql=/usr/bin/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-pear --with-zlib --with-gd --with-bz2 --with-jpeg-dir==/usr/local/jpeg --with-freetype-dir=/usr/local/freetype/ --with-openssl --enable-shared --enable-ftp --enable-ctype --enable-mbstring --prefix=/usr/local/php

#make

#make install

#cp php.ini-recommended /usr/local/php/etc/php.ini

#echo AddType application/x-httpd-php .php>>/usr/local/apache2/conf/httpd.conf

最后根据make install 返回的安装完成的信息.

You may want to add: /usr/local/php/lib/php to your php.ini include_path

把路径添加到php.ini文件里的include_path里面去.保存.

至此,PHP安装完成.

查看phpinfo()文件,返回结果已经显示gd支持jpeg格式了。

OK。

现在再安装PHPCMS SP2,进入后台登录界面。 OK, 一切正常。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。