我一直在尝试做一些PECL安装,但是它们都返回相同types的错误。 与时区有关的东西? 我运行RedHat x86_64 es5。
试图安装geoip-1.0.7:
root@server [~]# pecl install geoip-1.0.7 downloading geoip-1.0.7.tgz ... Starting to download geoip-1.0.7.tgz (9,416 bytes) .....done: 9,416 bytes Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead in PEAR/Validate.php on line 489 Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead in /usr/local/lib/php/PEAR/Validate.php on line 489 3 source files, building running: phpize Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 building in /var/tmp/pear-build-root/geoip-1.0.7 running: /root/tmp/pear/geoip/configure checking for egrep... grep -E checking for a sed that does not truncate output... /bin/sed checking for cc... cc checking for C compiler default output file name... a.out checking whether the C compiler works... configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details. ERROR: `/root/tmp/pear/geoip/configure' failed
到底是怎么回事? 任何人可以协助请…
从我的经验来看,“pecl install packagename”很less起作用。
我只需下载最新的pecl压缩包,解压缩,phpize(确保php在你编译/安装之后在你的path中),./configure,make,make install,service php-fpm restart
所以,比如说,使用geo-ip pecl软件包,尝试一下
wget http://pecl.php.net/get/geoip-1.0.8.tgz
cd geoip-1.0.8
phpize
。/configuration
使
进行安装
echo“extenstion = geoip.so”>> /path/to/php.ini
sudo服务php-fpm | apache restart
编辑:
如果你缺less一个开发包,编译错误会告诉你,然后你
yum install missingpkg-dev
编辑:
你的软件包似乎没有安装的具体原因是它是为不同的系统构build的。 一般来说,如果你从源代码编译,你会更快乐,因为你知道发生了什么事情。
尝试:
mount -o remount,exec,suid /tmp mount -o remount,exec,suid /var/tmp
时区警告 (您应该通过在php.ini中设置时区来更正)与实际问题完全分开,即“错误:无法运行C编译的程序”行。 您可能没有gcc和/或从您的软件包pipe理器make安装。 yum groupinstall "Development Tools"或yum install gcc make可能会有所斩获。