我安装并激活了execPHP插件并使用了这个
<?php echo "hello"; ?>
<?php include ("/test/test.php") ?>
在wordpress的tinyMCE中。
我看到hello输出正确,但后来我看到了这个错误;
警告:include(/test/test.php)[function.include]:无法打开流:D:\ Hosting \ 5291199 \ html \ sites \ Main \ wp-content \ plugins \中没有此类文件或目录exec-php \ includes \ runtime.php(42):第3行的eval()代码
警告:include()[function.include]:在D:\ Hosting \ 5291199 \ html \中打开'/test/test.php'以包含(include_path ='。; C:\ php5 \ pear')失败sites \ Main \ wp-content \ plugins \ exec-php \ includes \ runtime.php(42):第3行的eval()代码
我确信,/test/test.php
存在!它有有效的PHP代码......
答案 0 :(得分:0)
您必须使用完整路径
echo dir(__FILE__); // Find out in what folder you are
include (dirname(__FILE__) . "/../test/test.php"); // then adjust to the location of the file from this path