[FIXED] AutoInstaller - phpMyAdmin has no TempDir access on Debian 11

Discussion in 'Installation/Configuration' started by Outbreaker, Sep 22, 2022.

Tags:
  1. Outbreaker

    Outbreaker Member

    Hi,
    Yesterday i setup my Server with the AutoInstaller on a fresh installed Debian 11.
    But when i login into the phpMyAdmin i get this error below.
    Code:
    The $cfg['TempDir'] (/var/lib/phpmyadmin/tmp) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.
    On my old Debian 9 server everything works fine.
    I also saw that the "/var/lib/phpmyadmin/tmp" folder has the Permissions set to "750" instead of "770" and the Group/Owner is correct set to "ispapps www-data". I also have a folder called "twig" which has a bunch of other folders and php files, which i don't have on my Debian 9 phpMyAdmin "tmp" folder. :eek:
     
    Last edited: Sep 22, 2022
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    So it works now after you manually changed permissions to 0770 ?
     
    mlmateos likes this.
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    And how did you access phpmyadmin, did you use it through the apps vhost as set up by ISPConfig?

    https://yourdomain.tld:8081/phpmyadmin

    As such a permission issue can be caused also by using a different URL.
     
  4. Outbreaker

    Outbreaker Member

    When i change the "tmp" folder including the subfolder "twig" to "770" than the message is gone but the option is still not available in the Import section.
    And if i access phpMyAdmin with "http://8X.57.X1.X5:8081/phpmyadmin" than i get this error below.
    Code:
    Bad Request
    Your browser sent a request that this server could not understand.
    Reason: You're speaking plain HTTP to an SSL-enabled server port.
    Instead use the HTTPS scheme to access this URL, please.
    
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Use HTTPS as mentioned in my example, not HTTP. One of the reasons that we configure it for port 8081 (apps vhost) is that phpmyadmin is secured by HTTPS then with the system's central SSL certificate.
     
  6. Outbreaker

    Outbreaker Member

    If i use "https://8X.57.X1.X5:8081/phpmyadmin" i get this error below.
    I also noticed that the "/var/lib/phpmyadmin/tmp/twig/dc" folder is set to Group/Owner "www-data www-data", but all other folders are set to "ispapps www-data".
    Code:
    <?php
    
    declare(strict_types=1);
    
    use PhpMyAdmin\Common;
    use PhpMyAdmin\Routing;
    
    if (! defined('ROOT_PATH')) {
       // phpcs:disable PSR1.Files.SideEffects
       define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
       // phpcs:enable
    }
    
    if (PHP_VERSION_ID < 70205) {
       die('<p>PHP 7.2.5+ is required.</p><p>Currently installed version is: ' . PHP_VERSION . '</p>');
    }
    
    // phpcs:disable PSR1.Files.SideEffects
    define('PHPMYADMIN', true);
    // phpcs:enable
    
    require_once ROOT_PATH . 'libraries/constants.php';
    
    /**
     * Activate autoloader
     */
    if (! @is_readable(AUTOLOAD_FILE)) {
       die(
           '<p>File <samp>' . AUTOLOAD_FILE . '</samp> missing or not readable.</p>'
           . '<p>Most likely you did not run Composer to '
           . '<a href="https://docs.phpmyadmin.net/en/latest/setup.html#installing-from-git">'
           . 'install library files</a>.</p>'
       );
    }
    
    require AUTOLOAD_FILE;
    
    global $route, $containerBuilder, $request;
    
    Common::run();
    
    $dispatcher = Routing::getDispatcher();
    Routing::callControllerForRoute($request, $route, $dispatcher, $containerBuilder);
    
     
  7. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    And that error is?
     
  8. Outbreaker

    Outbreaker Member

    The error i get is in the Code Quote i posted above. That's 1:1 what is being displayed in my browser.
     
  9. Outbreaker

    Outbreaker Member

    On my old Debian 9 server i can access phpMyAdmin with https://<IP> with port 8080 and port 8081 and the option TempDir is available.
    I'm not a Linux expert, but I don't think i did a mistake because my old Debian 9 server was setup without AutoInstaller. :eek:
     
    Last edited: Sep 22, 2022
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Most likely there were changes in Debian so we have to alter the auto-installer again. I'll take a look at that when I do the tests for the next auto-installer release.
     
    mlmateos likes this.
  11. Outbreaker

    Outbreaker Member

    Damn those bugs have always a way to find me. :oops: If you lucky and find a way to fix this bug then please post a manual instruction for people that have already installed ISPConfig.
    Oh by the way could this bug also be related to the upload limit bug too?
     
    mlmateos likes this.
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    This is not a bug. You manually changed a file and it did not work the way you wanted. I just revisited the thread and I guess I know why your attempt to change it did not work, the changes you made are for mod_php only and as recent systems do not use mod_php anymore as its incompatible with http/2, you must use a different way to set the value. What might work is a PHP user in file, or you must modify the php-fpm starter for the process that runs as www-data user.
     
  13. Outbreaker

    Outbreaker Member

    I now also found a fix for this problem too.
    Edit file "/usr/share/phpmyadmin/config.inc.php" and change the UploadDir and SaveDir entries. :)
    Code:
    $cfg['UploadDir'] = '/var/lib/phpmyadmin/tmp';
    $cfg['SaveDir'] = '/var/lib/phpmyadmin/tmp';
     

Share This Page