使用 MAMP 安装 PEAR MDB2 时出现问题
我在我的 macbook 上安装了 MAMP 的副本,这样我就可以在本地运行基于 php/mysql 的网站。
MAMP 包本身似乎工作正常,但我需要 PEAR MDB2 包。
我做了以下安装,
pear install MDB2
pear install MDB2_Driver_mysql
pear channel-update pear.php.net
所有显然都有效,如果我再试一次,他们说已经安装了。
php.ini 中设置的 php include 路径看起来也是正确的:
include_path = ".:/Applications/MAMP/bin/php5.3/lib/php"
但是在重新启动服务器并尝试访问我的网站后,我仍然得到
致命错误:require_once() [function.require]:无法在 /Applications/MAMP 中打开所需的“MDB2.php”(include_path='.:/Applications/MAMP/bin/php5.3/lib/php') /htdocs/config.php 第 5 行
I've installed a copy of MAMP on my macbook so I can run my php/mysql based website locally.
The MAMP package itself seems to work fine but I needed the PEAR MDB2 Package.
I did the following to install
pear install MDB2
pear install MDB2_Driver_mysql
pear channel-update pear.php.net
All apparently worked and if I try again, they say already installed.
The php include path set in php.ini also looks to be correct:
include_path = ".:/Applications/MAMP/bin/php5.3/lib/php"
Yet after restarting the server and trying to hit my site, I still get
Fatal error: require_once() [function.require]: Failed opening required 'MDB2.php' (include_path='.:/Applications/MAMP/bin/php5.3/lib/php') in /Applications/MAMP/htdocs/config.php on line 5
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
/Applications/MAMP/bin/php5.3/lib/php
是 PEAR 的根目录吗?这听起来不对。运行命令pear config-get php_dir
,它会告诉您 PEAR 根目录在哪里(尽管配置名称具有误导性)。默认为/usr/share/pear
。Is
/Applications/MAMP/bin/php5.3/lib/php
the root directory for PEAR? That doesn't sound right. Run the commandpear config-get php_dir
, it will tell you where the PEAR root directory is (despite the misleading configuration name). The default is/usr/share/pear
.