最近遇到一台装有Fedora Core 5.0 Linux操作系统的服务器,原来安装的Apache 2.0、PHP 5.1.2不支持GD库,PHP网页中用GD库生成的验证码图片、统计图都无法显示。我试过在此基础上安装php-gd-5.1.2-5.i386.rpm包后还是不行。于是,想到了先卸载已安装PHP的所有RPM包,再重装PHP的方法。于是动手尝试,问题解决。
  
  一、在/var目录下新建一个临时目录php,将Fedora Core 5.0第2~5张光盘RPM目录中,以“php-”开头的RPM文件复制到/var/php目录中;
  
  二、在终端中执行以下命令(红字部分):
  1、查看已安装的PHP有哪些RPM包:
  [root@smis ~]# rpm -qa|grep php
  php-pear-1.4.6-2
  php-5.1.2-5
  php-gd-5.1.2-5
  php-ldap-5.1.2-5
  
  2、卸载用上述命令查看后列出的RPM包:
  [root@smis ~]# rpm -e php-pear-1.4.6-2 php-5.1.2-5 php-gd-5.1.2-5 php-ldap-5.1.2-5
  
  3、进入/var/php目录:
  [root@smis ~]# cd /var/php
  
  4、列出/var/php目录下的文件:
  [root@smis php]# ls
  php-5.1.2-5.i386.rpm           php-ncurses-5.1.2-5.i386.rpm
  php-bcmath-5.1.2-5.i386.rpm    php-odbc-5.1.2-5.i386.rpm
  php-dba-5.1.2-5.i386.rpm       php-pdo-5.1.2-5.i386.rpm
  php-devel-5.1.2-5.i386.rpm     php-pear-1.4.6-2.noarch.rpm
  php-gd-5.1.2-5.i386.rpm        php-pgsql-5.1.2-5.i386.rpm
  php-imap-5.1.2-5.i386.rpm      php-snmp-5.1.2-5.i386.rpm
  php-ldap-5.1.2-5.i386.rpm      php-soap-5.1.2-5.i386.rpm
  php-mbstring-5.1.2-5.i386.rpm  php-xml-5.1.2-5.i386.rpm
  php-mysql-5.1.2-5.i386.rpm     php-xmlrpc-5.1.2-5.i386.rpm
  
  5、安装你需要的组件的RPM包:
  [root@smis php]# rpm -ivh php-5.1.2-5.i386.rpm php-ncurses-5.1.2-5.i386.rpm php-bcmath-5.1.2-5.i386.rpm php-odbc-5.1.2-5.i386.rpm php-dba-5.1.2-5.i386.rpm php-pdo-5.1.2-5.i386.rpm php-devel-5.1.2-5.i386.rpm php-pear-1.4.6-2.noarch.rpm php-gd-5.1.2-5.i386.rpm php-pgsql-5.1.2-5.i386.rpm php-snmp-5.1.2-5.i386.rpm php-ldap-5.1.2-5.i386.rpm php-soap-5.1.2-5.i386.rpm php-mbstring-5.1.2-5.i386.rpm php-xml-5.1.2-5.i386.rpm php-mysql-5.1.2-5.i386.rpm php-xmlrpc-5.1.2-5.i386.rpm
  warning: php-5.1.2-5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
  Preparing...                ########################################### [100%]
     1:php                    ########################################### [  6%]
     2:php-pdo                ########################################### [ 12%]
     3:php-ncurses            ########################################### [ 18%]
     4:php-bcmath             ########################################### [ 24%]
     5:php-odbc               ########################################### [ 29%]
     6:php-dba                ########################################### [ 35%]
     7:php-devel              ########################################### [ 41%]
     8:php-pear               ########################################### [ 47%]
     9:php-gd                 ########################################### [ 53%]
    10:php-pgsql              ########################################### [ 59%]
    11:php-snmp               ########################################### [ 65%]
    12:php-ldap               ########################################### [ 71%]
    13:php-soap               ########################################### [ 76%]
    14:php-mbstring           ########################################### [ 82%]
    15:php-xml                ########################################### [ 88%]
    16:php-mysql              ########################################### [ 94%]
    17:php-xmlrpc             ########################################### [100%]
  
  6、重新启动Apache服务:
  [root@smis php]# service httpd restart
  停止 httpd:                                               [确定]
  启动 httpd:                                               [确定]
  
  7、完毕。

Tags: ,



技术大类 » PHP/JS/Shell | 评论(46) | 引用(0) | 阅读(55156)
shzzz Email
2022-7-30 18:46
Great tips and very easy to understand. This will definitely be very useful for me when I get a chance to start my blog.  Scam Risk
shz Email
2022-7-30 18:47
You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant!  Scam Risk
shz Email
2022-7-30 18:58
I need to to thank you for this very good read!! I definitely loved every little bit of it. I have you bookmarked to check out new things you post…  Scam Risk
shzz Email
2022-7-30 19:15
cool you write, the information is very good and interesting, I'll give you a link to my site.  Scam Risk
메이저놀이터 Email
2022-12-5 15:35
How amazing this article is!!! It is the article which can help me to look back on myself while reading an article about 메이저놀이터, and to grow in the future rather than always beating myself up and staying in one place.
Lucky cola
2024-2-7 16:46
Unleash your inner gamer and dominate the virtual realm.  Lucky cola
分页: 3/3 第一页 上页 1 2 3 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]