ckfinder 的图像浏览在 ckeditor 上无法正常工作 php

ckfinder's browse for images not working properly on ckeditor php

我正在研究核心 php。有一个产品页面可以添加或编辑它们的标题描述、图片等

对于产品描述,我使用了 ckeditor 插件,它工作得很好,但是没有上传图片的选项,所以我又添加了一个插件 ckfinder 来上传图片。当我点击浏览图片上传时,它打开一个空白 window 并显示这条消息

The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.

我不知道这是什么意思,我该如何配置它。

这是我的 HTML 代码 index.html:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="javascript" type="text/javascript" src="ckeditor/ckeditor.js"></script>
</head>

<body>
<textarea name="testEditor" id="testEditor"></textarea>
<script>
    // Replace the <textarea id="editor1"> with a CKEditor
    // instance, using default configuration.
    CKEDITOR.replace( 'testEditor',
                        {
                            filebrowserBrowseUrl : 'http://localhost/editor/ckfinder/ckfinder.html',
                            filebrowserImageBrowseUrl : 'http://localhost/editor/ckfinder/ckfinder.html?type=Images',
                            filebrowserFlashBrowseUrl : 'http://localhost/editor/ckfinder/ckfinder.html?type=Flash',
                            filebrowserUploadUrl : 'http://localhost/editor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
                            filebrowserImageUploadUrl : 'http://localhost/editor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
                            filebrowserFlashUploadUrl : 'http://localhost/editor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
                            filebrowserWindowWidth : '1000',
                            filebrowserWindowHeight : '700'
                        }
                    );
</script>

请帮助我,我是第一次使用 ckeditor 和 ckfinder。

检查 CKFinder 根目录中的 config.php 文件。

默认情况下,由于身份验证限制,CKFinder 将无法使用。您必须首先确保已正确配置它,然后再启用它。这是为了确保未经授权的用户无法上传和访问您服务器上的文件。

一旦您完全配置了 CKFinder,您就可以启用它了。 CheckAuthentication() 函数用于此。在此函数中,您必须实施代码以确保请求来自经过身份验证的用户。这通常是通过在用户登录到您的系统时分配一个会话变量来完成的。

您可以阅读更多内容in the documentation here

请注意,与 CKEditor 不同,CKFinder 不是开源产品,您 need a license 将其用于评估以外的目的。