gpt4 book ai didi

php - 调用未定义的函数 geoip

转载 作者:太空宇宙 更新时间:2023-11-04 04:14:38 25 4
gpt4 key购买 nike

我安装了 PHP 5.4 和 GeoIP,但我无法让 GeoIP 工作。错误是:

fatal error :在第 7 行/var/www/html/geoip/test.php 中调用未定义的函数 geoip_country_code_by_name()

这是脚本:

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
//$gi = geoip_open( "GeoIP.dat",GEOIP_STANDARD);
$country = geoip_country_code_by_name('www.example.com');
if ($country) {
echo 'This host is located in: ' . $country;
}
?>

我安装了 PEAR/PECL 还是什么都没有。

是否存在 geoip 日志错误或可以帮助解决问题的内容?

我还使用 PHP 5.3 安装了 GeoIP,它工作正常。问题出在 PHP 5.4

谢谢。

最佳答案

似乎配置错​​误或者您给出的函数名称错误。检查它是否已成功安装/激活;

if (function_exists("Function_Name_Here")) {
echo "Function Does Exist";
} else {
echo "Function Does Not Exist";
}

如果此功能“不存在”,请重新跟踪您的安装步骤,并查阅此扩展的官方手册以获取确切的安装说明。

关于php - 调用未定义的函数 geoip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17259712/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com