开发者社区> 科技小能手> 正文

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

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
PHP:CentOS Linux环境下源码编译安装PHP8.0
PHP:CentOS Linux环境下源码编译安装PHP8.0
54 0
Ubuntu 12.04 安装PHP
Ubuntu 12.04 安装PHP
80 0
Ubuntu18.04下PHP安装gRPC
Ubuntu18.04下PHP安装gRPC
58 0
安装memcached 和 php-memcached 实现PHP访问memcached
安装memcached 和 php-memcached 实现PHP访问memcached
24 0
CentOS7 部署安装FastDFS多机版(三)——安装FastDFS的PHP扩展
CentOS7 部署安装FastDFS多机版(三)——安装FastDFS的PHP扩展
42 0
如何修复“PHP 安装缺少 WordPress 所需的 MySQL 扩展”的错误?
在WordPress建站,WordPress定制开发过程中,开发者容易遇见“您的 PHP 安装似乎缺少 WordPress 所需的 MySQL 扩展”的错误提示,如果出现这样的情况,应该怎么办?北京六翼信息有限公司的开发工程师指出,要修复错误“您的 PHP 安装似乎缺少 WordPress 所需的 MySQL 扩展”,您需要确保您的 PHP 安装已正确安装和配置 MySQL 数据库驱动程序 (mysqlnd) 和 mysqli 扩展。只有这样,您才能恢复 WordPress 和 WordPress 数据库之间的正常连接,并让您的网站重新运行。
96 0
QGS
(openEuler21.03-Centos7-x86)yum安装php+nginx—配置nginx解析php
记(openEuler21.03-Centos7-x86)yum安装php+nginx—配置nginx解析php
265 0
QGS
(openEuler21.03-Centos7-x86)yum安装php+apache
记(openEuler21.03-Centos7-x86)yum安装php+apache
66 0
QGS
(openEuler21.03-x86)yum安装php+apache—shell脚本
记(openEuler21.03-x86)yum安装php+apache—shell脚本
45 0
【技术分享】Win10环境php安装seaslog扩展
【技术分享】Win10环境php安装seaslog扩展
60 0
window 安装多个 php
window 安装多个 php
76 0
Centos php 扩展方式安装gd库的方法
Centos php 扩展方式安装gd库的方法
151 0
【web开发基础】php开发基础快速入门(1)-PHP介绍及开发环境快速安装和基本使用介绍
互联网时代,网站是一种非常重要的通讯工具,只要用户有网络和权限,随时随地可访问任意网页,个人可以通过网站发布自己的想要公开的资讯,或者利用网站提供相关的网络服务,企业网站,对于企业来说,是企业对外的窗口,是企业的名片。可通过网站宣传企业自身以及品牌的推广,甚至交流,产品的销售或提供服务工具。在飞速发展的时代,快速开发,快速部署,快速迭代也成了互联网软件行业一直追求的目标,毕竟机会稍纵即逝。而PHP最大好处在于开发部署快速,而且生态完善,社区活跃度高,类库丰
74 0
【常见问题】宝塔面板如何安装最新版本的php扩展swoole
宝塔面板能提高我们非运维专业人员的管理效率,但是也会损失一些灵活性,要根据需求灵活使用工具。
188 0
+关注
科技小能手
文章
问答
视频
相关电子书
更多
PHP 2017.北京 全球开发者大会——高可用的PHP
立即下载
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载
相关实验场景
更多