require_once不在MacBook Pro上工作(山狮),而是在所有其他平台上工作


require_once not working on MacBook Pro ( Mountain Lion ) but working on all other platforms

我遇到了一个奇怪的问题,我在我的MacBook Pro上尝试了MAMP和PhP/Apache的标准安装,但总是收到此错误

警告: require_once(./interfaces/class-ai1ec-get-data-from-cache.php): 无法打开流:中没有此类文件或目录 /usr/local/zend/apache2/htdocs/wordpress/wp-content/plugins/all-in-one-event-calendar-premium/app/strategies/get_data_from_cache/class-ai1ec-get-data-from-db-cache.php 在第 3 行 致命错误:require_once():需要打开失败 '../interfaces/class-ai1ec-get-data-from-cache.php' (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear') 在 /usr/local/zend/apache2/htdocs/wordpress/wp-content/plugins/all-in-one-event-calendar-premium/app/strategies/get_data_from_cache/class-ai1ec-get-data-from-db-cache.php 在第 3 行

从这个电话

require_once ( '/../interfaces/class-ai1ec-get-data-from-cache.php' );

我是Mac的新手,所以它一定是非常愚蠢的,但我被阻止了。

当然,我尝试了每个版本

require_once ( '../interfaces/class-ai1ec-get-data-from-cache.php' );
require_once ( './../interfaces/class-ai1ec-get-data-from-cache.php' );

这毫无意义:

require_once ( '/../interfaces/class-ai1ec-get-data-from-cache.php' );

您从根目录开始,然后尝试从那里向上访问目录。

尝试输入实际的完整文件路径,看看是否有效。