centos5安装PHP5时遇到问题

简介:

 PHP版本:5.3.1,操作系统:centos5.4

    手动编译安装GD,然后在安装PHP时指定GD安装路径,configure通过,make通过,make test无法通过:  

    imagecopyresampled() [ext/gd/tests/imagecopyresampled_basic.phpt] (warn:ing:require_once(skipif_imagetype.inc):failed to open stream:NO such file or directory in /usr/local/php-5.3.1/ext/gd/tests/imagecopyresampled_basic.skip.php on line 3) 

    imagedashedline() [ext/gd/tests/imagedashedline_basic.phpt] (warn:ing:require_once(skipif_imagetype.inc):failed to open stream:No such file or directory in /usr/local/php-5.3.1/ext/gd/tests/imagedashedline_basic.skip.php on line 3)
    imageploygon() [ext/gd/tests/imagepolygon_basic.phpt] (warn:ing:require_once(skipif_imagetype.inc):failed to open stream:NO such file or directory in /usr/local/php-5.3.1/ext/gd/tests/imagepolygon_basic.skip.php on line 3)
    via [ext/pdo_sqlite/tests/common.phpt] 
    SQLite PDO Common:Bug #34630 (inserting streams as LOBs) [ext/pdo_sqlite/tests/bug_34630.phpt] (warn:XFAIL section but test passes) 
    via [ext/pdo_sqlite/tests/common.phpt]
    SQLite PDO Common:Bug #34630 (inserting streams as LOBs) [ext/pdo_sqlite/tests/bug_34630.phpt] (warn:XFAIL section but test passes)
 
    重新编译第一次:按照PHP的PAQ所说,安装PHP时不指定GD安装路径。
     configure通过,make无法通过:
     collect2: ld returned 1 exit status
     make: *** [sapi/cli/php] Error 1
 
      重新编译第二次:编译时指定GD路径,对GD库的其它选项使用 --with-jpeg-dir=/usr/local --with-zlib-dir --with-png-dir=/usr/local --with-freetype-dir=/usr/local --with-gd=/usr/local/gd。
 configure通过,make通过,make test时解决了前三个问题,只出现SQLite2 PDO和SQLite PDO的错误
 
      重新编译第三次:因为phpmyadmin提示“无法加载mcrypt扩展,请检查您的PHP配置,所以重新编译PHP,加入--with-mcrypt选项,结果在编译PHP时遇到了不少问题。
     1、Configure: error: libjpeg.(also) not found.
     2、Configure: error: libpng.(also) not found.
     解决:yum install libjpeg-devel   
                yum install libpng-devel
    3、error: freetype.h not found.
    解决:缺少freetype-devel,yum install freetype-devel
    4、遇到configure: error: mcrypt.h not found. Please reinstall libmcrypt.而libcrypt已经安装,在网上查了一下资料,发现是缺少libmcrypt-devel。
     解决:yum install libmcrypt-devel
 
   重新编译第四次:遇到:
   /usr/bin/ld: cannot find -lltdl
   collect2: ld returned 1 exit status
   make: *** [libphp5.la] Error 1
   解决:错误原因是缺少libltdl。
   yum install libtool-ltdl libtool-ltdl-devel
 
  最终编译时指定了以下参数,禁用SQLite2 PDO和SQLite PDO,问题全部解决:
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/share/mysql --with-jpeg-dir=/usr --with-png-dir=/usr --with-freetype-dir=/usr --with-gd --enable-exif --enable-mbstring --enable-soap --with-mcrypt --with-curl =/usr/local/curl --with-libxml-dir=/usr/local/libxml2 /bin/xml2-config --without-pdo-sqlite --without-sqlite 
本文转自 li_qinshan 51CTO博客,原文链接:http://blog.51cto.com/share/265798
相关文章
|
1月前
|
存储 Ubuntu Linux
VMware-安装CentOS系统教程及安装包
虚拟机相当于是一个独立于你电脑的环境,在这个环境上面,你可以安装Linux、Windows、Ubuntu等各个类型各个版本的系统,在这个系统里面你不用担心有病读等,不用担心文件误删导致系统崩溃。 虚拟机也和正常的电脑系统是一样的,也可以开关机,不用的时候,你关机就可以了,也不会占用你的系统资源,使用起来还是比较方便 这里也有已经做好的CentOS 7系统,下载下来解压后直接用VMware打开就可以使用
421 69
|
1月前
|
Ubuntu Linux 索引
Centos 7、Debian及Ubuntu系统中安装和验证tree命令的指南。
通过上述步骤,我们可以在CentOS 7、Debian和Ubuntu系统中安装并验证 `tree`命令。在命令行界面中执行安装命令,然后通过版本检查确认安装成功。这保证了在多个平台上 `tree`命令的一致性和可用性,使得用户无论在哪种Linux发行版上都能使用此工具浏览目录结构。
223 78
|
2月前
|
Linux 网络安全 Apache
针对在Centos/Linux安装Apache过程中出现的常见问题集锦
以上每个问题的解决方案应深入分析错误日志、系统消息和各种配置文件,以找到根本原因并加以解决。务必保持系统和Apache软件包更新到最新版本,以修复已知的bugs和安全漏洞。安装和管理Web服务器是一项需要细致关注和不断学习的任务。随着技术的发展,推荐定期查看官方文档和社区论坛,以保持知识的更新。
174 80
|
26天前
|
存储 关系型数据库 MySQL
在CentOS 8.x上安装Percona Xtrabackup工具备份MySQL数据步骤。
以上就是在CentOS8.x上通过Perconaxtabbackup工具对Mysql进行高效率、高可靠性、无锁定影响地实现在线快速全量及增加式数据库资料保存与恢复流程。通过以上流程可以有效地将Mysql相关资料按需求完成定期或不定期地保存与灾难恢复需求。
116 10
|
2月前
|
JavaScript Linux PHP
composer如何安装以及举例在PHP项目中使用Composer安装TCPDF库-优雅草卓伊凡
composer如何安装以及举例在PHP项目中使用Composer安装TCPDF库-优雅草卓伊凡
118 3
composer如何安装以及举例在PHP项目中使用Composer安装TCPDF库-优雅草卓伊凡
|
1月前
|
运维 网络协议 Linux
CentOS下Bind服务的安装与故障排查
通过以上的步骤,您应该能够在CentOS系统上安装并配置BIND DNS服务,并进行基本的故障排查。
174 0
|
2月前
|
人工智能 数据挖掘 Linux
Centos安装Python3.7(亲测可用)
本指南详细介绍了在基于Linux(以CentOS系统为例,使用yum包管理器)的系统上安装Python 3.7版本的完整流程。Python是一种广泛使用的高级编程语言,在各种领域如软件开发、数据分析、人工智能和区块链开发等都有着重要的应用。
259 2
|
3月前
|
机器人 Linux
CentOS 7系统中安装特定版本CMake 3.21.2的方法。
到这里,过程已经全部完成。如果你跟随上面的步骤来,那么你现在已经拥有了一个全新的CMake版本在你的CentOS 7系统上了。这个过程就像是你通过一系列仪式,唤醒了一个沉睡已久的古老机器人,它现在完全按照你的意愿来帮你构建和编译软件了。
223 18
|
3月前
|
自然语言处理 测试技术 API
TCPDF库详解:功能、作用及多语言安装指南-tcpdf可不是只有php能用-优雅草卓伊凡
TCPDF库详解:功能、作用及多语言安装指南-tcpdf可不是只有php能用-优雅草卓伊凡
311 5