0

Hi I am getting this 500 internal server error as soon as I click the responsivefilemanager upload file button in the TinyMCE toolbar.

Here are the screenshots of it: enter image description here

enter image description here

I have the following js TinyMCE initialization code:

<script>
        tinymce.init({
            selector: "textarea",
            plugins: [
                "advlist autolink link image lists charmap print preview hr anchor pagebreak",
                "searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking",
                "table contextmenu directionality emoticons paste textcolor responsivefilemanager code codesample"
            ],
            toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect",
            toolbar2: "| responsivefilemanager | link unlink anchor | image media | codesample | forecolor backcolor  | print preview code ",
            image_advtab: true,
            branding: false,

            external_filemanager_path: "plugins/tinymce/plugins/filemanager/",
            filemanager_title: "Filemanager for projecthub",
            external_plugins: {
                "filemanager": "plugins/filemanager/plugin.min.js"
            }
        });
    </script>

with this file structure:

-project folder name
    -index.php (which also apparently contains the javascript TinyMCE initialization code)
    -plugins folder (which contains TinyMCE folder)
        -TinyMCE folder
            -plugins folder (which contains all the plugins for TinyMCE)
                -responsivefilemanager folder
                    -config
                        -config.php file

Here is my basic config.php code (the code is exactly the same as the default responsivefilemanager config file but with the uploads folder and the thumbnail folder URL edited, I couldn't post the whole code because StackOverflow doesn't allow more than 33000 characters on a post)

<?php
/*
    |--------------------------------------------------------------------------
    | DON'T TOUCH (base url (only domain) of site).
    |--------------------------------------------------------------------------
    |
    | without final / (DON'T TOUCH)
    |
    */
    'base_url' => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http"). "://". @$_SERVER['HTTP_HOST'],
    /*
    |--------------------------------------------------------------------------
    | path from base_url to base of upload folder
    |--------------------------------------------------------------------------
    |
    | with start and final /
    |
    */
    'upload_dir' => '/projecthub/uploads/',
    /*
    |--------------------------------------------------------------------------
    | relative path from filemanager folder to upload folder
    |--------------------------------------------------------------------------
    |
    | with final /
    |
    */
    'current_path' => '../../../../uploads/',

    /*
    |--------------------------------------------------------------------------
    | relative path from filemanager folder to thumbs folder
    |--------------------------------------------------------------------------
    |
    | with final /
    | DO NOT put inside upload folder
    |
    */
    'thumbs_base_path' => '../../../../thumb/',

    /*
    |--------------------------------------------------------------------------
    | path from base_url to base of thumbs folder
    |--------------------------------------------------------------------------
    |
    | with final /
    | DO NOT put inside upload folder
    |
    */
    'thumbs_upload_dir' => '../../../../thumb/'

?>
LIL LOFIE
  • 277
  • 2
  • 12
  • the most relevant info is not posted. Your php code, the actual error from your server logs. – YvesLeBorg Aug 22 '20 at 12:36
  • @YvesLeBorg ahh ok lemme post that just stick around with me – LIL LOFIE Aug 22 '20 at 12:37
  • @YvesLeBorg I have added as much as PHP code as I can but not all because StackOverflow doesn't allow posts to exceed more than 33000 characters as I mentioned above in my question – LIL LOFIE Aug 22 '20 at 12:41
  • well, you could forget the screen shots (useless) , and probably the js in this case, and report the actual error log(s) from your server. http(s) error_log, possibly you may have a php-fpm which has its own error log. Also, there is a reason for 3300: **[Read all about a minimal, complete, verifiable example (MCVE)](https://stackoverflow.com/help/mcve)** – YvesLeBorg Aug 22 '20 at 12:44
  • @YvesLeBorg OK so what should I do right now? because the only thing I get in the error_log files is the 500 internal server error. – LIL LOFIE Aug 22 '20 at 12:48
  • https://stackoverflow.com/questions/2687730/how-can-i-make-php-display-the-error-instead-of-giving-me-500-internal-server-er – YvesLeBorg Aug 22 '20 at 12:49
  • @YvesLeBorg OK I'll try that but can you tell me where is my php.ini file available at? I am on a production server though. – LIL LOFIE Aug 22 '20 at 12:54
  • no. it is your environment, the onus is on you. I wont veture a WAG on such matters. Am voting to close, insufficient detail – YvesLeBorg Aug 22 '20 at 13:11
  • @YvesLeBorg OK so I somehow managed to get out of this problem but got into a new one please take a look at it: https://stackoverflow.com/questions/63538160/responsivefilemanager-wont-work-and-give-no-errrors-even-though-everything-is-s – LIL LOFIE Aug 22 '20 at 15:58
  • @YvesLeBorg I wasn't able to find what the error was but I managed to fix it by redownloading the exact same version of TinyMCE and using it again with the exact same code IDK how it worked but I am good with it. – LIL LOFIE Sep 11 '20 at 12:48

0 Answers0