设为首页 收藏本站
查看: 1253|回复: 0

[经验分享] 安装php-5.3.28 时问题

[复制链接]

尚未签到

发表于 2018-12-19 09:34:55 | 显示全部楼层 |阅读模式
  在linux下安装php时,(我安装的时5.2.6)phptar.gz压缩包解压缩之后。
  在分配路径和关联扩展包时遇到错误如下:
  --------------------------------------------------------
  Sorry, I cannot run apxs. Possible reasons follow:
  1. Perl is not installed
  2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
  3. Apache was not built using --enable-so (the apxs usage page is displayed)
  ---------------------------------------------------
  解决步骤:
  1、根据不能run apxs 。cd 到apache的bin目录下运行./apxs 运行结果
  ----------------------------------------------------
  bash: ./apxs: /replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory
  ---------------------------------------------------------
  2、vim apxs文件 找“/replace/with/path/to/perl/interpreter”关键字
  在第一个行 :#!/replace/with/path/to/perl/interpreter -w
  根据perl的安装目录 /usr/bin/perl
  修改为:#! /usr/bin/perl -w
  3、运行第一步。或者直接 ./configure ^^^^^
  问题解决
  configure 代码如下:
  ./configure--prefix=/usr/local/php/--with-config-file-path=/usr/local/php/etc/--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql=/usr/local/mysql/--with-libxml-dir=/usr/local/libxml2/--with-jpeg-dir=/usr/local/jpeg6/--with-freetype-dir=/usr/local/freetype/--with-gd=/usr/local/gd2/--with-mcrypt=/usr/local/libmcrypt/--with-mysqli=/usr/local/mysql/bin/mysql_config--enable-soap--enable-mbstring=all--enable-sockets
  总结一下用源代码安装LAMP环境中遇到常见的错误,从错误3开始是因为安装php后面带参数,导到没有找到开发包例如:./configure --with-gd  --with-libjpeg会出现如下错误。
  1.checking for termcap functions library... configure: error: No curses/termcap library found
  解决方法:yum install ncurses      --缺少ncurses安装包
  2.1)安装gd库出现以下错误:
  In file included from /root/php-5.3.6/ext/gd/libgd/gd_compat.c:8:
  /usr/local/jpeg/include/jpeglib.h:938: error: expected declaration specifiers or ‘...’ before ‘FILE’
  /usr/local/jpeg/include/jpeglib.h:939: error: expected declaration specifiers or ‘...’ before ‘FILE’
  make: *** [ext/gd/libgd/gd_compat.lo] Error 1
  解决方法:vim  php-5.3.6/ext/gd/libgd/gd_compat.c
  #include     --修改为#include
  #include   --添加这行
  3. Configure: error: xml2-config not found. Please check your libxml2 installation.
  Solutions :
  解决方法:yum install libxml2 libxml2-devel
  4. Configure: error: Please reinstall the BZip2 distribution
  Solutions :
  解决方法:yum install bzip2 bzip2-devel
  5. Configure: error: libjpeg.(also) not found.
  Solutions :
  解决方法:yum install libjpeg libjpeg-devel
  6.Configure: error: libpng.(also) not found.
  Solutions :
  解决方法:yum install libpng libpng-devel
  7.Configure: error: Cannot find MySQL header files under /usr.
  Note that the MySQL client library is not bundled anymore!
  Solutions:
  解决方法:yum install mysql-devel
  8.没有安装snmp开发包
  checking for SNMP support... yes
  checking OpenSSL dir for SNMP... no
  checking whether to enable UCD SNMP hack... no
  checking for net-snmp-config... (cached) /usr/bin/net-snmp-config
  configure: error: snmp.h not found. Check your SNMP installation.
  [root@RedHat1 php-5.2.17]#
  解决方法:yum install net-snmp net-snmp-devel
  9.apache端口被占用了
  [root@redhat1 bin]# ./httpd
  (98)Address already in use: make_sock: could not bind to address [::]:80
  (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
  no listening sockets available, shutting down
  Unable to open logs
  [root@redhat1 bin]#
  解决方法:80端口被占用了,杀掉占用80端口的进程
  10.没有指定主机IP地址
  [root@redhat1 bin]# ./httpd

  httpd: Could not>  [root@redhat1 bin]#
  解决方法:vim /usr/local/apache/conf/httpd.conf
  ServerName localhost          --添加这一行就可以了
  10.访问网站时出现下载页面
DSC0000.jpg

  解决方法:vim /usr/local/apache/conf/httpd.conf    --加载php模块
  LoadModule php5_module        modules/libphp5.so


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-653067-1-1.html 上篇帖子: PHP将session保存到memcache服务器 下篇帖子: 总结php删除html标签和标签内的内容的方法
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表