源码编译安装php出现的错误汇总
1、 碰到错误 xpm.h not found
# yum install libXpm-devel //注意x为大写
# yum install libXext-devel //注意x为大写
2、碰到错误 gmp.h not found
#yum install gmp
#yum install gmp-devel
3、碰到错误 error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen
#yum install libc-client-devel
4、碰到错误 error: Unable to detect ICU prefix or /usr/bin/icu-config failed
#yum install libicu*
#yum install icu*
5、碰到错误 error: ODBC header file '/usr/include/sqlext.h' not found
#yum install unixODBC-devel
6、碰到错误 error: Cannot find pspell
#yum install aspell-devel
7、碰到错误 error: Can not find recode.h anywhere under /usr /usr/local /usr /opt.
#yum install recode
#yum install recode-devel
8、碰到错误 error: Could not find net-snmp-config binary
#yum install net-snmp-devel
9、碰到错误 error: Cannot find libtidy
#yum install libtidy-devel
php 安装完毕了 , 测试 了一下 php 页面, 问题依旧, 最终仔细看了一下, phpinfo() 函数显示的版本是 5.2.17, 而我安装的是 5.5.0, 显然 nginx 服务器使用的还是
老的 php, 没有启用我最新编译安装的 php, 查找了一下, 老的 php 的目录是 /usr/local/bin/php, 而我新安装的php目录是 /usr/bin/php
为何不用最新的php呢, 显然与 环境变量PATH有关 , 执行命令 env , 看到
PATH=/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
我们可以修改 /etc/profile 文件 , 把文件最后一行 :
export PATH=/usr/local/mysql/bin:$PATH
修改为
export PATH=/usr/local/mysql/bin:/usr/bin:$PATH
然后
# cd /etc
# source profile 重新加载 profile 文件
最后再测试 php 文件, curl_exec 可以访问 https 文件, 并取到数据了。
---------------------
作者:langeldep
来源:CSDN
原文:https://blog.csdn.net/langeldep/article/details/44227973
版权声明:本文为博主原创文章,转载请附上博文链接!