Install PHP file manager for TinyMCE 5 and 4 using Composer

The most modern way is to add Flmngr file manager package into your PHP app using Composer and map some URL using its API.

To download and install edsdk/flmngr-server-php package, use this console command:

composer require edsdk/flmngr-server-php

Let Flmngr to handle some URL

In your code that processes a request to some URL you will specify to N1ED later, add the following call:

use EdSDK\FlmngrServer\FlmngrServer;

FlmngrServer::flmngrRequest(
    array(
        'dirFiles' => '/var/www/files',
        'dirCache' => '/var/www/files/cache',
        'dirTmp'   => '/var/www/files/tmp'
    )
);

You can learn more about installing the package on the Flmngr for PHP module page and see example of integration on our GitHub.

Paths configuration

It is recommended to use absolute paths for all directories to avoid mistakes.

Check also the access rights for all these directories: system user used for your application or website must have both read and write right to them. For example in Ubuntu this used is called www-data, in other Linux distributions there can be other names for it i. e. apache or some custom user.

dirFiles - the place where you store all the files and images which are browsed by Flmngr file manager. You can use your existing storage you had before N1ED installation and Flmngr file manager will work like a charm with it.

dirCache and dirTmp directories can be located anywhere and do not need to be publicly accessed from the web at all. Just be sure they exist.

Link Flmngr file manager with the server

File Uploader settings screenshot
Configuring File Manager

Go to Dashboard and click on the button "Configure" under "Server side uploader" title. The configuration window will appear to let you configure server side URLs for the client side of Flmngr.

File Manager URL (Flmngr.urlFileManager parameter) - Set the URL on which your Flmngr backend is linked to. This depends on how you installed your backend in the previous steps. N1ED will call this URL to ask your server about something (list files, upload a file, etc.). For PHP installation in probably should contain the full URL of flmngr.php file. Please use the absolute link (with protocol and domain) to avoid mistakes.

Files URL (Flmngr.urlFiles parameter) - Specify the prefix of URL where your files and images are available through the web. For example, if you have URL of some published image like https://example.com/images/demo.png, probably the correct Files URL will be https://example.com/images. This parameter depends on dirFiles parameter you specified on the server. The difference is server configuration explains where to store files on disc, and this client configuration explains how to access files from web.

Please see how this URL work:

Client side configuration: prefix for URLs
Files URL (Flmngr.urlFiles parameter)
http://your-website.com/files/
/var/www/files/
Server side configuration: location of your files
config['dirFiles'] parameter in backend config
+ /path/to/image.png

(optional) Uploads directory - The directory which will store uploaded files without a parent directory specified (quick uploads). The path starts from the root of your files stored on the server. For example you store files in /var/www/images and want to store all quick uploads in /var/www/images/uploads, the correct value here will be /uploads/ (be sure this directory exists on the server). Keep the default / value to set root storage directory as default storage directory.