Mpdf \ MpdfException (E_ERROR)
Temporary files directory "/tmp/sllgo28403/domains/testowy001.devsel.pl/public_html/application/mpdf//mpdf" is not writable Mpdf\MpdfException thrown with message "Temporary files directory "/tmp/sllgo28403/domains/testowy001.devsel.pl/public_html/application/mpdf//mpdf" is not writable" Stacktrace: #8 Mpdf\MpdfException in /opt/sellingo/sellingo-vendor-php84/16337809/mpdf/mpdf/src/Cache.php:21 #7 Mpdf\Cache:__construct in /opt/sellingo/sellingo-vendor-php84/16337809/mpdf/mpdf/src/ServiceFactory.php:75 #6 Mpdf\ServiceFactory:getServices in /opt/sellingo/sellingo-vendor-php84/16337809/mpdf/mpdf/src/Mpdf.php:1076 #5 Mpdf\Mpdf:__construct in /home/sllgo28403/domains/testowy001.devsel.pl/public_html/modules/sellingo/classes/esprzedaz/mpdf.php:32 #4 Esprzedaz_Mpdf:getMpdf in /home/sllgo28403/domains/testowy001.devsel.pl/public_html/modules/sellingo/classes/controller/catalog/products.php:7022 #3 Controller_Catalog_Products:action_print in [internal]:0 #2 ReflectionMethod:invokeArgs in /home/sllgo28403/domains/testowy001.devsel.pl/public_html/system/classes/kohana/request/client/internal.php:132 #1 Kohana_Request_Client_Internal:execute in /home/sllgo28403/domains/testowy001.devsel.pl/public_html/modules/sellingo/classes/kohana/request.php:479 #0 Kohana_Request:execute in /home/sllgo28403/domains/testowy001.devsel.pl/public_html/index.php:136
Stack frames (9)
8
Mpdf\MpdfException
/16337809/mpdf/mpdf/src/Cache.php:21
7
Mpdf\Cache __construct
/16337809/mpdf/mpdf/src/ServiceFactory.php:75
6
Mpdf\ServiceFactory getServices
/16337809/mpdf/mpdf/src/Mpdf.php:1076
5
Mpdf\Mpdf __construct
/home/sllgo28403/domains/testowy001.devsel.pl/public_html/modules/sellingo/classes/esprzedaz/mpdf.php:32
4
Esprzedaz_Mpdf getMpdf
/home/sllgo28403/domains/testowy001.devsel.pl/public_html/modules/sellingo/classes/controller/catalog/products.php:7022
3
Controller_Catalog_Products action_print
[internal]:0
2
ReflectionMethod invokeArgs
/home/sllgo28403/domains/testowy001.devsel.pl/public_html/system/classes/kohana/request/client/internal.php:132
1
Kohana_Request_Client_Internal execute
/home/sllgo28403/domains/testowy001.devsel.pl/public_html/modules/sellingo/classes/kohana/request.php:479
0
Kohana_Request execute
/home/sllgo28403/domains/testowy001.devsel.pl/public_html/index.php:136
/opt/sellingo/sellingo-vendor-php84/16337809/mpdf/mpdf/src/Cache.php
 
namespace Mpdf;
 
use DirectoryIterator;
 
class Cache
{
 
    private $basePath;
 
    private $cleanupInterval;
 
    public function __construct($basePath, $cleanupInterval = 3600)
    {
        if (!is_int($cleanupInterval) && false !== $cleanupInterval) {
            throw new \Mpdf\MpdfException('Cache cleanup interval has to be an integer or false');
        }
 
        if (!$this->createBasePath($basePath)) {
            throw new \Mpdf\MpdfException(sprintf('Temporary files directory "%s" is not writable', $basePath));
        }
 
        $this->basePath = $basePath;
        $this->cleanupInterval = $cleanupInterval;
    }
 
    protected function createBasePath($basePath)
    {
        if (!file_exists($basePath)) {
            if (!$this->createDirectory($basePath)) {
                return false;
            }
        }
 
        if (!is_writable($basePath) || !is_dir($basePath)) {
            return false;
        }
 
        return true;
    }
Arguments
  1. "Temporary files directory "/tmp/sllgo28403/domains/testowy001.devsel.pl/public_html/application/mpdf//mpdf" is not writable"
    
/opt/sellingo/sellingo-vendor-php84/16337809/mpdf/mpdf/src/ServiceFactory.php
        $scriptToLanguage,
        $fontDescriptor,
        $bmp,
        $directWrite,
        $wmf
    ) {
        $sizeConverter = new SizeConverter($mpdf->dpi, $mpdf->default_font_size, $mpdf, $logger);
 
        $colorModeConverter = new ColorModeConverter();
        $colorSpaceRestrictor = new ColorSpaceRestrictor(
            $mpdf,
            $colorModeConverter
        );
        $colorConverter = new ColorConverter($mpdf, $colorModeConverter, $colorSpaceRestrictor);
 
        $tableOfContents = new TableOfContents($mpdf, $sizeConverter);
 
        $cacheBasePath = $config['tempDir'] . '/mpdf';
 
        $cache = new Cache($cacheBasePath, $config['cacheCleanupInterval']);
        $fontCache = new FontCache(new Cache($cacheBasePath . '/ttfontdata', $config['cacheCleanupInterval']));
 
        $fontFileFinder = new FontFileFinder($config['fontDir']);
 
        if ($this->container && $this->container->has('httpClient')) {
            $httpClient = $this->container->get('httpClient');
        } elseif (\function_exists('curl_init')) {
            $httpClient = new CurlHttpClient($mpdf, $logger);
        } else {
            $httpClient = new SocketHttpClient($logger);
        }
 
        $localContentLoader = $this->container && $this->container->has('localContentLoader')
            ? $this->container->get('localContentLoader')
            : new LocalContentLoader();
 
        $assetFetcher = $this->container && $this->container->has('assetFetcher')
            ? $this->container->get('assetFetcher')
            : new AssetFetcher($mpdf, $localContentLoader, $httpClient, $logger);
 
/opt/sellingo/sellingo-vendor-php84/16337809/mpdf/mpdf/src/Mpdf.php
            $mode,
            $format,
            $default_font_size,
            $default_font,
            $mgl,
            $mgr,
            $mgt,
            $mgb,
            $mgh,
            $mgf,
            $orientation
        ) = $this->initConstructorParams($config);
 
        $this->logger = new NullLogger();
 
        $originalConfig = $config;
        $config = $this->initConfig($originalConfig);
 
        $serviceFactory = new ServiceFactory($container);
        $services = $serviceFactory->getServices(
            $this,
            $this->logger,
            $config,
            $this->languageToFont,
            $this->scriptToLanguage,
            $this->fontDescriptor,
            $this->bmp,
            $this->directWrite,
            $this->wmf
        );
 
        $this->container = $container;
        $this->services = [];
 
        foreach ($services as $key => $service) {
            $this->{$key} = $service;
            $this->services[] = $key;
        }
 
        $this->time0 = microtime(true);
/home/sllgo28403/domains/testowy001.devsel.pl/public_html/modules/sellingo/classes/esprzedaz/mpdf.php
            }
            define('_MPDF_TEMP_PATH', $mpdf_temp_path);
        }
        if (!defined('_MPDF_TTFONTDATAPATH')) {
            $mpdf_font_path = APPPATH.'mpdf/fonts/';
            if (!is_dir($mpdf_font_path)) {
                @mkdir($mpdf_font_path, 0755);
            }
            define('_MPDF_TTFONTDATAPATH', $mpdf_font_path);
        }
 
        // require_once SYSPATH.'vendor/vendor/mpdf/mpdf/mpdf.php';
    }
 
    public static function getMpdf($config)
    {
        $appath = str_replace(['/home/', '/var/www/clients/', 'client0/', '//'], ['', '', '', '/'], APPPATH);
 
        $config['tempDir'] = '/tmp/'.$appath.'mpdf/';
        $mpdf = new Mpdf($config);
        if (is_dir('/tmp/'.$appath)) {
            $fileowner = fileowner(APPPATH.'bootstrap.php');
            $filegroup = filegroup(APPPATH.'bootstrap.php');
            system('chown '.$fileowner.':'.$filegroup.' /tmp/'.$appath.' -R', $foo);
        }
 
        return $mpdf;
    }
}
 
/home/sllgo28403/domains/testowy001.devsel.pl/public_html/modules/sellingo/classes/controller/catalog/products.php
                            'breadcrumb_path' => $breadcrumb_path,
                            'attributes' => $attributes,
                            'opinions' => $opinions,
                            'average' => $average,
                            'opinion_errors' => $opinion_errors,
                            'variants_all' => $variants_all,
                            'options' => $options,
                            'options_all' => $options_all,
                            'props' => $propss,
                            'url' => $url,
                        ]
                    )->render();
 
                    KCache::instance()->set($cachename, $data);
                }
                // require Kohana::find_file('vendor/MPDF57', 'mpdf');
                Esprzedaz_Mpdf::setConfig();
                $this->response->headers('Content-Type', 'application/pdf');
                $this->response->send_headers();
                $mpdf = Esprzedaz_Mpdf::getMpdf(
                    [
                        'format' => 'A4',
                        'default_font_size' => 9,
                        'default_font' => 'DejaVuSans',
                    ]
                );
                // $mpdf = new mPDF('iso-8859-2', 'A4', 9, 'DejaVuSans');
                $mpdf->WriteHTML($data);
                $mpdf->SetHTMLFooter(
                    '<div style="text-align: right; font-size: 2mm; font-family: oswaldcondensed; "><a href="https://sellingo.pl" style="text-decoration: none; color: #000;">Oprogramowanie sklepu internetowego Sellingo.pl</a></div>'
                );
                $mpdf->Output(url::title($item->title).'.pdf', 'D');
 
                exit;
            }
        }
 
        throw new Kohana_Http_Exception_404();
    }
 
[internal]
/home/sllgo28403/domains/testowy001.devsel.pl/public_html/system/classes/kohana/request/client/internal.php
            // If the action doesn't exist, it's a 404
            if (!$class->hasMethod('action_'.$action)) {
                throw new Http_Exception_404('The requested URL :uri was not found on this server.',
                    [':uri' => $request->param('uri')]);
            }
 
            $method = $class->getMethod('action_'.$action);
 
            /**
             * Execute the main action with the parameters
             *
             * @deprecated $params passing is deprecated since version 3.1
             *             will be removed in 3.2.
             */
 
            if (!empty($params) && array_keys($params) !== range(0, count($params) - 1)) {
                $params = array_values($params);
            }
 
            $method->invokeArgs($controller, $params);
 
            // Execute the "after action" method
            $class->getMethod('after')->invoke($controller);
 
            // Stop response time
            $this->_response_time = (time() - $this->_response_time);
 
            // Add the default Content-Type header to initial request if not present
            if ($initial_request AND !$request->headers('content-type')) {
                $request->headers('content-type', Kohana::$content_type.'; charset='.Kohana::$charset);
            }
        } catch (Http_Exception_404 $e) {
            if (Request::$find_in_shop) {
                // Restore the previous request
                Request::$current = $previous;
 
                if (isset($benchmark)) {
                    // Delete the benchmark, it is invalid
                    Profiler::delete($benchmark);
                }
/home/sllgo28403/domains/testowy001.devsel.pl/public_html/modules/sellingo/classes/kohana/request.php
     *
     *     $request->execute();
     *
     * @return Response
     *
     * @throws Kohana_Exception
     *
     * @uses    [Kohana::$profiling]
     * @uses    [Profiler]
     */
    public function execute()
    {
        if (!$this->_client instanceof Kohana_Request_Client) {
            throw new Kohana_Request_Exception(
                'Unable to execute :uri without a Kohana_Request_Client',
                [':uri', $this->uri]
            );
        }
 
        return $this->_client->execute($this);
    }
 
    public static function factory($uri = true, ?Kohana_Cache $cache = null)
    {
        // If this is the initial request
        if (!Request::$initial) {
            if (Kohana::$is_cli) {
                // Default protocol for command line is cli://
                $protocol = 'cli';
 
                // Get the command line options
                $options = CLI::options('uri', 'method', 'get', 'post', 'referrer');
 
                if (isset($options['uri'])) {
                    // Use the specified URI
                    $uri = $options['uri'];
                }
 
                if (isset($options['method'])) {
                    // Use the specified method
/home/sllgo28403/domains/testowy001.devsel.pl/public_html/index.php
if (!defined('KOHANA_START_MEMORY')) {
    define('KOHANA_START_MEMORY', memory_get_usage());
}
 
// Bootstrap the application
require APPPATH.'bootstrap'.EXT;
 
/**
 * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
 * If no source is specified, the URI will be automatically detected.
 */
if (PHP_SAPI == 'cli' && defined('USE_MINION')) // Try and load minion
{
    class_exists('Minion_Task') OR die('Please enable the Minion module for CLI support.'.PHP_EOL);
    set_exception_handler(['Minion_Exception', 'handler']);
 
    Minion_Task::factory(Minion_CLI::options())->execute();
} else {
    $data = Request::factory()
        ->execute()
        ->send_headers()
        ->body();
}
echo $data;
 
if (isset($blackfire)) {
    $profile = $blackfire->endProbe($probe);
}

Environment & details:

empty
empty
empty
empty
empty
Key Value
USER
"sllgo28403"
HOME
"/home/sllgo28403"
HTTP_CONNECTION
"keep-alive"
HTTP_CACHE_CONTROL
"max-age=259200"
HTTP_X_FORWARDED_FOR
"10.10.8.202"
HTTP_VIA
"1.1 squid-proxy-5b96dc6d46-9jgrc (squid/6.13)"
HTTP_HOST
"testowy001.devsel.pl"
HTTP_ACCEPT_ENCODING
"gzip, br, zstd, deflate"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_ACCEPT
"*/*"
SCRIPT_FILENAME
"/home/sllgo28403/domains/testowy001.devsel.pl/public_html/index.php"
REDIRECT_STATUS
"200"
SERVER_NAME
"testowy001.devsel.pl"
SERVER_PORT
"80"
SERVER_ADDR
"5.187.54.110"
REMOTE_PORT
"21685"
REMOTE_ADDR
"216.73.217.145"
SERVER_SOFTWARE
"nginx/1.25.3"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.1"
DOCUMENT_ROOT
"/home/sllgo28403/domains/testowy001.devsel.pl/public_html"
DOCUMENT_URI
"/index.php"
REQUEST_URI
"/print_product/257"
SCRIPT_NAME
"/index.php"
CONTENT_LENGTH
""
CONTENT_TYPE
""
REQUEST_METHOD
"GET"
QUERY_STRING
""
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1788277614.3283
REQUEST_TIME
1788277614
empty
0. Whoops\Handler\PrettyPageHandler