我正在尝试使用HHVM的geoip扩展。我按照所有说明将其安装在我的开发机器上,一切正常。然后我将它部署到我的实时服务器,一切都出错了。
我知道扩展程序已加载到实时服务器上,因为:
root@live:~/hhvm# hhvm --php -r 'print_r(get_loaded_extensions());'
Array
(
[0] => apc
[1] => array
[2] => asio
[3] => async_mysql
[4] => bcmath
[5] => bz2
[6] => collections
[7] => ctype
[8] => curl
[9] => date
[10] => debugger
[11] => dom
[12] => domdocument
[13] => enum
[14] => exif
[15] => fb
[16] => fileinfo
[17] => filter
[18] => gd
[19] => generator
[20] => geoip
[21] => hash
[22] => hh
[23] => hh_client
[24] => hhvm.debugger
[25] => hhvm.ini
[26] => hosthealthmonitor
[27] => hotprofiler
[28] => iconv
[29] => idn
[30] => imagick
[31] => imap
[32] => intervaltimer
[33] => intl
[34] => json
[35] => ldap
[36] => libxml
[37] => mail
[38] => mailparse
[39] => mbstring
[40] => mcrouter
[41] => mcrypt
[42] => memcache
[43] => memcached
[44] => mysql
[45] => mysqli
[46] => objprof
[47] => openssl
[48] => pcntl
[49] => pcre
[50] => pdo
[51] => pdo_mysql
[52] => pdo_sqlite
[53] => phar
[54] => posix
[55] => readline
[56] => redis
[57] => reflection
[58] => server
[59] => session
[60] => SimpleXML
[61] => soap
[62] => sockets
[63] => spl
[64] => sqlite3
[65] => standard
[66] => stream
[67] => string
[68] => sysvmsg
[69] => sysvsem
[70] => sysvshm
[71] => thread
[72] => thrift_protocol
[73] => tokenizer
[74] => url
[75] => wddx
[76] => xenon
[77] => xhprof
[78] => xml
[79] => xmlreader
[80] => xmlwriter
[81] => xsl
[82] => zip
[83] => zlib
)
但我总是在现场得到这个错误:
Fatal error: Call to undefined function geoip_country_code_by_name() in
然后我也尝试在控制台上运行它:
hhvm --php -r 'print_r(geoip_country_code_by_name("www.google.com"));'
> US
然后我也试了phpinfo()
并在显示我的浏览器上执行了它:
hhvm.dynamic_extensions Array ( [0] => geoip.so )
显然这意味着它实际上是在nginx的环境中加载的。我似乎无法找到问题。