【发布时间】:2011-12-08 16:41:59
【问题描述】:
我正在尝试在为 PHP CLI 编写的脚本中 throw new Exception(...)。
这是错误:
PHP Fatal error: require(): Failed opening required '/Exception.php'
(include_path='.:/usr/share/php:/usr/share/pear') in /file.php
这是引用的行:
if (!file_exists($path)) {
if (!mkdir($path)) {
throw new Exception('Unable to create directory: ' . $path);
}
}
这是一个配置问题还是其他原因导致了这个?
我之前没有写过任何用于 PHP CLI 的东西,所以不确定很多类似的东西。
感谢大家的帮助。
【问题讨论】: