มีใครเคยใช้ CKeditor+CKfinder บน IIS ใน Windows Server บ้างไหมครับ มีปัญหานิสหน่อยครับผม
ผมใช้ IIS บน Windows 10 เป็นเครื่องใช้เขียนโปรแกรม
จะ Run ใช้จริงบน Windows Server 2012 R2 ซึ่งก็ใช้ IIS เหมือนกัน
แต่พอจะใช้ CKfinder แล้ว เหมือนจะติปัญหาที่ Permission ครับ
พอเปิดปลั๊กอิน File-manager ขึ้นมา มันฟ้องว่า Invalid request. ครับ
...........
ลองใช้ VM ลง XAMPP กลับใช้งานได้ปกติ พี่ๆ พอจะให้คำแนะนำในการแก้ไขได้ไหมครับ
หน้า Editor
<!DOCTYPE html>
<html>
<head>
<title>TEST</title>
<script type="text/javascript" src="./ckeditor/ckeditor.js"></script>
</head>
<body>
<textarea name="editor1" id="editor1"></textarea>
<script type="text/javascript">
CKEDITOR.replace( 'editor1',{
filebrowserBrowseUrl: './ckfinder/ckfinder.html',
filebrowserImageBrowseUrl: './ckfinder/ckfinder.html?type=Images',
filebrowserUploadUrl: './ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
filebrowserImageUploadUrl: './ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images'
});
</script>
</body>
</html>
หน้า Conpfig.php
<?php
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
ini_set('display_errors', 0);
// Development
// error_reporting(E_ALL);
// ini_set('display_errors', 1);
$config = array();
$config['authentication'] = function () {
return true;
};
$config['licenseName'] = '';
$config['licenseKey'] = '';
$config['privateDir'] = array(
'backend' => 'default',
'tags' => '.ckfinder/tags',
'logs' => '.ckfinder/logs',
'cache' => '.ckfinder/cache',
'thumbs' => '.ckfinder/cache/thumbs',
);
$config['images'] = array(
'maxWidth' => 1600,
'maxHeight' => 1200,
'quality' => 80,
'sizes' => array(
'small' => array('width' => 480, 'height' => 320, 'quality' => 80),
'medium' => array('width' => 600, 'height' => 480, 'quality' => 80),
'large' => array('width' => 800, 'height' => 600, 'quality' => 80)
)
);
$config['backends'][] = array(
'name' => 'default',
'adapter' => 'local',
'baseUrl' => '/ckfinder/userfiles/',
// 'root' => '', // Can be used to explicitly set the CKFinder user files directory.
'chmodFiles' => 0777,
'chmodFolders' => 0755,
'filesystemEncoding' => 'UTF-8',
);
$config['defaultResourceTypes'] = '';
$config['resourceTypes'][] = array(
'name' => 'Files', // Single quotes not allowed.
'directory' => 'files',
'maxSize' => 0,
'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip',
'deniedExtensions' => '',
'backend' => 'default'
);
$config['resourceTypes'][] = array(
'name' => 'Images',
'directory' => 'images',
'maxSize' => 0,
'allowedExtensions' => 'bmp,gif,jpeg,jpg,png',
'deniedExtensions' => '',
'backend' => 'default'
);
$config['roleSessionVar'] = 'CKFinder_UserRole';
$config['accessControl'][] = array(
'role' => '*',
'resourceType' => '*',
'folder' => '/',
'FOLDER_VIEW' => true,
'FOLDER_CREATE' => true,
'FOLDER_RENAME' => true,
'FOLDER_DELETE' => true,
'FILE_VIEW' => true,
'FILE_CREATE' => true,
'FILE_RENAME' => true,
'FILE_DELETE' => true,
'IMAGE_RESIZE' => true,
'IMAGE_RESIZE_CUSTOM' => true
);
$config['overwriteOnUpload'] = false;
$config['checkDoubleExtension'] = true;
$config['disallowUnsafeCharacters'] = false;
$config['secureImageUploads'] = true;
$config['checkSizeAfterScaling'] = true;
$config['htmlExtensions'] = array('html', 'htm', 'xml', 'js');
$config['hideFolders'] = array('.*', 'CVS', '__thumbs');
$config['hideFiles'] = array('.*');
$config['forceAscii'] = false;
$config['xSendfile'] = false;
$config['debug'] = false;
$config['pluginsDirectory'] = __DIR__ . '/plugins';
$config['plugins'] = array();
$config['cache'] = array(
'imagePreview' => 24 * 3600,
'thumbnails' => 24 * 3600 * 365,
'proxyCommand' => 0
);
$config['tempDirectory'] = sys_get_temp_dir();
$config['sessionWriteClose'] = true;
$config['csrfProtection'] = true;
return $config;
Tag : PHP, CakePHP, Windows
Date :
2016-07-09 10:59:37
By :
dexjanghan
View :
2119
Reply :
3
Date :
2016-07-09 11:01:00
By :
dexjanghan
iis เข้าไปเช็ค php error มันแจ้งว่ายังไง ครับ จาก
Date :
2016-07-09 11:20:02
By :
Chaidhanan
แจ้งประมาณนี้ครับ
[09-Jul-2016 11:24:38 Asia/Krasnoyarsk] PHP Fatal error: Uncaught exception 'CKSource\CKFinder\Exception\InvalidConfigException' with message 'The temporary folder is not writable for CKFinder' in C:\inetpub\wwwroot\editor\ckfinder\core\connector\php\vendor\cksource\ckfinder\src\CKSource\CKFinder\Config.php:330
Stack trace:
#0 C:\inetpub\wwwroot\editor\ckfinder\core\connector\php\vendor\cksource\ckfinder\src\CKSource\CKFinder\Config.php(73): CKSource\CKFinder\Config->validate()
#1 C:\inetpub\wwwroot\editor\ckfinder\core\connector\php\vendor\cksource\ckfinder\src\CKSource\CKFinder\CKFinder.php(91): CKSource\CKFinder\Config->__construct('C:\\inetpub\\wwwr...')
#2 C:\inetpub\wwwroot\editor\ckfinder\core\connector\php\vendor\pimple\pimple\src\Pimple\Container.php(113): CKSource\CKFinder\CKFinder->CKSource\CKFinder\{closure}(Object(CKSource\CKFinder\CKFinder))
#3 C:\inetpub\wwwroot\editor\ckfinder\core\connector\php\vendor\cksource\ckfinder\src\CKSource\CKFinder\CKFinder.php(185): Pimple\Container->offsetGet('config')
#4 C:\inetpub\wwwroot\editor\ckfinder\core\connector in C:\inetpub\wwwroot\editor\ckfinder\core\connector\php\vendor\cksource\ckfinder\src\CKSource\CKFinder\Config.php on line 330
Date :
2016-07-09 11:25:49
By :
dexjanghan
Load balance : Server 01