simogeo / Filemanager

An open-source file manager released under MIT license. Up-to-date for PHP connector. This package is DEPRECATED. Now, please use RichFileManager available at : https://github.com/servocoder/RichFilemanager.
938 stars 349 forks source link

No Way is all over the place #476

Closed AmrAlfoly closed 8 years ago

AmrAlfoly commented 8 years ago

i am using filemanager with Laravel and it works very well on my local machine but when i pushed the site to production the problems started and i managed to make the filemanager load correctly and to point to my files in public_html folder but when it loads all i can do is to upload one file correct and then it doesn't show it's thumbnail and when i try to enter any sub folders i got the No Way error what will kill me is when i point the filemanager to my public directory outside the public_html it woks great but i can't use this folder , i have changed permissions to 0777 for both folders and i have read all the issues in your repo and followed a lot of the fixes they talk about but still nothing for me hers is the code from my config file : `

{ "_comment": "IMPORTANT : go to the wiki page to know about options configuration https://github.com/simogeo/Filemanager/wiki/Filemanager-configuration-file", "options": { "culture": "ar", "lang": "php", "theme": "default", "defaultViewMode": "grid", "autoload": true, "showFullPath": false, "showTitleAttr": false, "browseOnly": false, "showConfirmation": true, "showThumbs": true, "generateThumbnails": true, "searchBox": true, "listFiles": true, "fileSorting": "default", "chars_only_latin": true, "splitterWidth": 250, "splitterMinWidth": 250, "dateFormat": "d M Y H:i", "serverRoot": false, "folder_path": "files/images/", "fileRoot": "/", "baseUrl": "/", "logger": true, "logfile": "mylog.txt", "capabilities": ["select", "download", "rename", "delete", "replace"], "plugins": [] }, "security": { "allowFolderDownload": false, "allowChangeExtensions": false, "allowNoExtension": false, "uploadPolicy": "DISALLOW_ALL", "uploadRestrictions": [ "jpg", "jpeg", "gif", "png", "svg", "txt", "pdf", "odp", "ods", "odt", "rtf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "csv", "ogv", "mp4", "webm", "m4v", "ogg", "mp3", "wav" ] }, "upload": { "multiple": true, "number": 5, "overwrite": false, "imagesOnly": false, "fileSizeLimit": 16 }, "exclude": { "unallowed_files": [ ".htaccess", "web.config" ], "unallowed_dirs": [ "_thumbs", ".CDN_ACCESS_LOGS", "cloudservers" ], "unallowed_files_REGEXP": "/^./", "unallowed_dirs_REGEXP": "/^./" }, "images": { "imagesExt": [ "jpg", "jpeg", "gif", "png", "svg" ], "resize": { "enabled":true, "maxWidth": 960, "maxHeight": 680 } }, "videos": { "showVideoPlayer": true, "videosExt": [ "ogv", "mp4", "webm", "m4v" ], "videosPlayerWidth": 400, "videosPlayerHeight": 222 }, "audios": { "showAudioPlayer": true, "audiosExt": [ "ogg", "mp3", "wav" ] }, "edit": { "enabled": false, "lineNumbers": true, "lineWrapping": true, "codeHighlight": false, "theme": "elegant", "editExt": [ "txt", "csv" ] }, "customScrollbar": { "enabled": true, "theme": "inset-2-dark", "button": true }, "extras": { "extra_js": [], "extra_js_async": true }, "icons": { "path": "images/fileicons/", "directory": "_Open.png", "default": "default.png" },

}`

simogeo commented 8 years ago

What is this `"folder_path": "files/images/" about in your config file ?

use fileRoot and serverRoot :

AmrAlfoly commented 8 years ago

i have removed the "folder_path" form the configuration file and used the instructions in your link to specify a user folder but i got this error

The directory /files/images/ does not exist.

the folder i am trying to point to is not at the same level as filemanager folder in my public directory so files/images is besides filemanager folder how can i point to the filemanager script to it then ?

AmrAlfoly commented 8 years ago

and if i tried to point to the files folder it doesn't work as mentioned in the wiki page i had to set serverRoot to false and filesRoot to files and i get this error

filemtime(): stat failed for /var/www/alamya/public/filesalbums the script is trying to list the folder in it (albums) is one of them but it fails what is the problem?

psolom commented 8 years ago

filemtime(): stat failed for /var/www/alamya/public/filesalbums the script is trying to list the folder in it (albums) is one of them but it fails what is the problem?

What is your OS? I faced similar problem on Windows. As I remebmer the issue was occured due to filenames in cp1251 encoding which is utilized in Windows OS. Anyway try to remove gaps in your filenames and any special chars.

AmrAlfoly commented 8 years ago

i am using Ubuntu which is a Linux distro and there is no gaps in the folder names even i tried to point the script to an empty folder the script loads without errors but when i try to create sub folder or upload an image it creates/upload outside the folder for example : my folder name was test and the scripts loaded very good without errors and i created a folder named mine inside it using the script i found that the folder created outside the test folder and it's name is testmine please help

simogeo commented 8 years ago

/var/www/alamya/public/filesalbums

it seems at least, on '/' is missging, no ?

Try to enable log and see what's happening related to paths : https://github.com/simogeo/Filemanager/wiki/Enable-log-debug-in-PHP-connector

AmrAlfoly commented 8 years ago

here is the output of the log file

[24/03/2016 04:54:57]#127.0.0.1#Filemanager::enableLog - Log enabled (in filemanager_log.txt file) [24/03/2016 04:54:57]#127.0.0.1#Filemanager::construct $this->root value /var/www/alamya/public/filemanager/ [24/03/2016 04:54:57]#127.0.0.1#Filemanager::construct $this->path_to_files /var/www/alamya/public/files/images/ [24/03/2016 04:54:57]#127.0.0.1#Filemanager::construct $this->doc_root value /var/www/alamya/public [24/03/2016 04:54:57]#127.0.0.1#Filemanager::__construct $this->separator value images [24/03/2016 04:54:57]#127.0.0.1#Filemanager::setFileRoot $this->doc_root value overwritten : /var/www/alamya/public//var/www/alamya/public/files/images/ [24/03/2016 04:54:57]#127.0.0.1#Filemanager::setFileRoot $this->dynamic_fileroot value /files/images/ [24/03/2016 04:54:57]#127.0.0.1#Filemanager::setFileRoot $this->path_to_files /var/www/alamya/public//var/www/alamya/public/files/images/ [24/03/2016 04:54:57]#127.0.0.1#Filemanager::setFileRoot $this->separator value images [24/03/2016 04:54:57]#127.0.0.1#substr path : / [24/03/2016 04:54:57]#127.0.0.1#real path : / [24/03/2016 04:54:57]#127.0.0.1#Filemanager::error - error message : The directory /files/images/ does not exist. [24/03/2016 04:54:57]#127.0.0.1#Filemanager::enableLog - Log enabled (in filemanager_log.txt file) [24/03/2016 04:54:57]#127.0.0.1#Filemanager::construct $this->root value /var/www/alamya/public/filemanager/ [24/03/2016 04:54:57]#127.0.0.1#Filemanager::construct $this->path_to_files /var/www/alamya/public/files/images/ [24/03/2016 04:54:57]#127.0.0.1#Filemanager::construct $this->doc_root value /var/www/alamya/public [24/03/2016 04:54:57]#127.0.0.1#Filemanager::__construct $this->separator value images [24/03/2016 04:54:57]#127.0.0.1#Filemanager::setFileRoot $this->doc_root value overwritten : /var/www/alamya/public//var/www/alamya/public/files/images/ [24/03/2016 04:54:57]#127.0.0.1#Filemanager::setFileRoot $this->dynamic_fileroot value /files/images/ [24/03/2016 04:54:57]#127.0.0.1#Filemanager::setFileRoot $this->path_to_files /var/www/alamya/public//var/www/alamya/public/files/images/ [24/03/2016 04:54:57]#127.0.0.1#Filemanager::setFileRoot $this->separator value images [24/03/2016 04:54:57]#127.0.0.1#substr path : / [24/03/2016 04:54:57]#127.0.0.1#real path : / [24/03/2016 04:54:57]#127.0.0.1#Filemanager::error - error message : The directory /files/images/ does not exist.

simogeo commented 8 years ago

$this->path_to_files /var/www/alamya/public//var/www/alamya/public/files/images/

sould be :

$this->path_to_files /var/www/alamya/public/files/images/

what do you pass as parameter to setFileRoot() ?

AmrAlfoly commented 8 years ago

i don't my config file is up you can check it i am using your repo through this laravel repo https://github.com/bestmomo/filemanager and i maid all the configurations your wiki pages says

simogeo commented 8 years ago

I don't technically know that connector but see here : https://github.com/bestmomo/filemanager/blob/master/public/filemanager/connectors/php/default.config.php#L87

You may ask support for bestmomo ?

AmrAlfoly commented 8 years ago

once i have removed this line the script worked good i am a week after my delivery date because of this mistake i guess in this week i have met with all the errors that might happen with your script and it turns out that it was someone else's mistake thank you for your response you really saved my day how can i pay back ?

simogeo commented 8 years ago

You can make a donation.

I'm also ok with gratefulness you already expressed. Some people don't even thank after having a problem solved - of course, I hate this.