[GH-ISSUE #493] Path "/" not detected #364

Closed
opened 2026-03-02 15:58:09 +03:00 by kerem · 2 comments
Owner

Originally created by @OursBlanc42 on GitHub (Feb 4, 2021).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/493

Hi there.
In the config.php, if I write :

// Root path for file manager
// use absolute path of directory i.e: '/var/www/folder' or $_SERVER['DOCUMENT_ROOT'].'/folder'
**$root_path = '/';**

To have access to have access to all directories ; i have the following error :
Root path "" not found!

how i can fix this ?
Thank you for your advice.
Regards

Originally created by @OursBlanc42 on GitHub (Feb 4, 2021). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/493 Hi there. In the config.php, if I write : ``` // Root path for file manager // use absolute path of directory i.e: '/var/www/folder' or $_SERVER['DOCUMENT_ROOT'].'/folder' **$root_path = '/';** ``` To have access to have access to all directories ; i have the following error : **Root path "" not found!** how i can fix this ? Thank you for your advice. Regards
kerem 2026-03-02 15:58:09 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@prasathmani commented on GitHub (Feb 4, 2021):

filemanager will work under web directory only

<!-- gh-comment-id:773328871 --> @prasathmani commented on GitHub (Feb 4, 2021): filemanager will work under web directory only
Author
Owner

@mul14 commented on GitHub (Feb 12, 2021):

@OursBlanc42 If you really need that, you can modify the source code.

Change this line:

$root_path = rtrim($root_path, '\\/');

To this:

$root_path = $root_path != '/' ? rtrim($root_path, '\\/') : '/';

That works perfectly for me.

<!-- gh-comment-id:777951802 --> @mul14 commented on GitHub (Feb 12, 2021): @OursBlanc42 If you really need that, you can modify the source code. Change this line: ```php $root_path = rtrim($root_path, '\\/'); ``` To this: ```php $root_path = $root_path != '/' ? rtrim($root_path, '\\/') : '/'; ``` That works perfectly for me.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#364
No description provided.