在我的一个magento模板phtml文件中,我试图包含一个单独的php文件。 当我包含它时我 得到任何输出,当我使用require而不是我得到以下错误 p>
致命错误:require():无法打开所需的'http://www.site.co.uk /dir/test.php'
(include_path='/home/usr/public_html/app/code/local:/home/usr/public_html/app/code/community:/home/usr/public_html/app/code/ core:/ home / usr / public_html / lib:。:/ usr / lib / php:/ usr / local / lib / php')/ home / usr / public_html / app / design / frontend / theme / edits / template / 第30行上的review / product / view / list.phtml
code> pre>
错误的第一行显示正确的url路径,当我直接转到它时,它可以工作 - 它只是不喜欢从phtml模板页面中包含/要求。 p>
我在phtml文件中尝试了以下内容(使用magento的BaseURL,绝对路径和相对路径): p>
<?php
$ root = Mage :: getBaseUrl (Mage_Core_Model_Store :: URL_TYPE_WEB);
require / include($ root.'dir / test.php');
?>
<?php
require / include('http://www.site。 co.uk/dir/test.php');
?>
<?php
require / include('../../../../../../ .. /../../dir/test.php');
?>
div>