【发布时间】:2013-11-01 22:24:48
【问题描述】:
所以我升级到 OS X 10.9 Mavericks 并尝试再次设置我的本地开发环境。如this thread 中所述,我运行了xcode-select --install,这让我可以成功编译扩展。我已确认扩展名存在于 /usr/lib/php/extensions/no-debug-non-zts-20100525 中,并且我已将 extension=redis.so 添加到我的 php.ini 文件中。
我没有看到任何与无法加载扩展相关的错误,phpinfo() 报告了预期的 extension_dir 并在其输出中显示了 extension=redis.so,确认我确实将其放入了正确的文件中。不幸的是,这是phpinfo() 输出中“redis”的唯一痕迹。
当我转到我的应用程序时,我收到错误消息:
Fatal error: Class 'Redis' not found in /Volumes/Storage/ty/Sites/audiomack/application/Bootstrap.php on line 95
我使用sudo pecl install redis安装了一次,手动下载phpredis zip并自己编译一次,结果相同。
知道为什么 PHP 不加载扩展吗?
我收到一个似乎无关的奇怪警告,但为了完整起见,我会提到它:在 php.ini 中,我设置了 date.timezone = America/New_York,但我的设置似乎被忽略了。 PHP 信息的“日期”部分仍将 date.timezone 显示为“无价值”,并给出我们都见过一百次的警告:
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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Volumes/Storage/ty/Sites/audiomack/public/phpinfo.php on line 2
编辑:是的,我反复重启了 apache,没有骰子
【问题讨论】:
-
不知道 edis 的内容,但对于时区位,请确保您正在编辑正确的 .ini 文件。
phpinfo()的输出将告诉您正在解析哪些文件。您可能已经修改了一个控制 CLI,但使用的是 SAPI .ini -
arrrrrghhh... php.ini 的 include_path 行中缺少的引号是罪魁祸首。我很震惊,因为它没有引发语法/解析错误
标签: php php-extension php-ini osx-mavericks