我们使用 TinyMCE 中的 MoxiManager 插件在我们的 PHP Web 应用程序中上传图像,我们注意到在 TinyMCE 编辑器中上传图像时出现错误:
file_get_contents():读取 8192 字节失败,errno=21 是一个目录
Stacktrace:
/Applications/MAMP/htdocs/news-web/www/vendors/tinymce/plugins/moxie/classes/Util/IniParser.php:23
/Applications/MAMP/htdocs/news-web/www/vendors/tinymce/plugins/moxie/classes/Util/IniParser.php:23
/Applications/MAMP/htdocs/news-web/www/vendors/tinymce/plugins/moxie/classes/Vfs/Local/FileConfigProvider.php:63
/Applications/MAMP/htdocs/news-web/www/vendors/tinymce/plugins/moxie/classes/Vfs/BaseFile.php:313
/Applications/MAMP/htdocs/news-web/www/vendors/tinymce/plugins/moxie/classes/Commands/BaseCommand.php:146
/Applications/MAMP/htdocs/news-web/www/vendors/tinymce/plugins/moxie/classes/Commands/ListRootsCommand.php:42
/Applications/MAMP/htdocs/news-web/www/vendors/tinymce/plugins/moxie/classes/CommandCollection.php:39
/Applications/MAMP/htdocs/news-web/www/vendors/tinymce/plugins/moxie/classes/CorePlugin.php:69
/Applications/MAMP/htdocs/news-web/www/vendors/tinymce/plugins/moxie/classes/Handlers/JsonRpcHandler.php:74
/Applications/MAMP/htdocs/news-web/www/vendors/tinymce/plugins/moxie/classes/CorePlugin.php:82
/Applications/MAMP/htdocs/news-web/www/vendors/tinymce/plugins/moxie/api.php:18
这是:
/**
* Loads and parses the specified file by path.
*
* @param string $path File path to ini file to parse.
*/
public function load($path) {
return $this->parse(file_get_contents($path));
}
但我不想弄乱它
也许我们的文件系统根路径错误。
$moxieManagerConfig['filesystem.rootpath'] = '/Applications/MAMP/htdocs/news-web/data/articles/images';
图像可用于:
http://localhost:8888/news-web/data/articles/images/image.jpg
或者文件夹可能缺少某些读/写权限,但请检查。
有人可以给我一个提示吗?
谢谢