Laravel临时文件目录“ /var/www/html/laravel/../temp/”不可写

时间:2018-08-26 08:43:21

标签: laravel

我有这样一个问题,我在laravel中有一个名为temp的目录,我不知道为什么不tmp我什至对整个目录都授予了laravel chmod -R 777 laravel的权限,并继续执行相同的操作,我知道该怎么做,但是如何使用库mpdf它得到消息 Laravel临时文件目录“ /var/www/html/laravel/../temp/”不可写

2 个答案:

答案 0 :(得分:0)

(1/1) MpdfException
Temporary files directory "/var/www/html/laravel/../temp/" is not writable

in Cache.php line 17
at Cache->__construct('/var/www/html/laravel/../temp/')
in Mpdf.php line 983
at Mpdf->__construct(array('tempDir' => '/var/www/html/laravel/../temp/', 'mirrorMargins' => 0, 'forcePortraitMargins' => false, 'displayDefaultOrientation' => false, 'printers_info' => false, 'bleedMargin' => 5, 'crossMarkMargin' => 5, 'cropMarkMargin' => 8, 'cropMarkLength' => 18, 'nonPrintMargin' => 8, 'defaultPagebreakType' => 'cloneall', 'margBuffer' => 2, 'pagenumPrefix' => '', 'pagenumSuffix' => '', 'nbpgPrefix' => '', 'nbpgSuffix' => '', 'defaultPageNumStyle' => '1', 'aliasNbPg' => '{nb}', 'aliasNbPgGp' => '{nbpg}', 'maxTTFFilesize' => 2000, 'percentSubset' => 30, 'useAdobeCJK' => false, 'repackageTTF' => false, 'allow_charset_conversion' => true, 'biDirectional' => false, 'autoScriptToLang' => false, 'baseScript' => 1, 'autoVietnamese' => true, 'autoArabic' => true, 'autoLangToFont' => false, 'useSubstitutions' => false, 'falseBoldWeight' => 5, 'allow_output_buffering' => false, 'enableImports' => false, 'collapseBlockMargins' => true, 'dpi' => 96, 'allow_html_optional_endtags' => true, 'ignore_invalid_utf8' => false, 'text_input_as_HTML' => false, 'incrementFPR1' => 10, 'incrementFPR2' => 20, 'incrementFPR3' => 30, 'incrementFPR4' => 50, 'restrictColorSpace' => 0, 'PDFX' => false, 'PDFXauto' => false, 'PDFA' => false, 'PDFAauto' => false, 'ICCProfile' => '', 'spotColors' => array(), 'spotColorIDs' => array(), 'debug' => false, 'debugfonts' => false, 'showImageErrors' => false, 'table_error_report' => false, 'table_error_report_param' => '', 'title2annots' => false, 'annotSize' => 0.5, 'annotMargin' => null, 'annotOpacity' => 0.5, 'anchor2Bookmark' => 0, 'bookmarkStyles' => array(), 'h2bookmarks' => array(), 'h2toc' => array(), 'indexUseSubentries' => true, 'CSSselectMedia' => 'print', 'forcePortraitHeaders' => false, 'defaultheaderfontsize' => 8, 'defaultheaderfontstyle' => 'BI', 'defaultheaderline' => 1, 'defaultfooterfontsize' => 8, 'defaultfooterfontstyle' => 'BI', 'defaultfooterline' => 1, 'header_line_spacing' => 0.25, 'footer_line_spacing' => 0.25, 'setAutoTopMargin' => false, 'setAutoBottomMargin' => false, 'autoMarginPadding' => 2, 'simpleTables' => false, 'packTableData' => false, 'ignore_table_percents' => false, 'ignore_table_widths' => false, 'keep_table_proportions' => true, 'shrink_tables_to_fit' => 1.3999999999999999, 'tableMinSizePriority' => false, 'use_kwt' => false, 'iterationCounter' => false, 'splitTableBorderWidth' => 0, 'decimal_align' => array('DP' => '.', 'DC' => ',', 'DM' => '·', 'DA' => '٫', 'DD' => '-'), 'interpolateImages' => false, 'img_dpi' => 96, 'useKerning' => false, 'justifyB4br' => false, 'tabSpaces' => 8, 'jSWord' => 0.40000000000000002, 'jSmaxChar' => 2, 'jSmaxCharLast' => 1, 'jSmaxWordLast' => 2, 'useFixedNormalLineHeight' => false, 'useFixedTextBaseline' => false, 'normalLineheight' => 1.3300000000000001, 'adjustFontDescLineheight' => 1.1399999999999999, 'smCapsScale' => 0.75, 'smCapsStretch' => 110, 'useDictionaryLBR' => true, 'useTibetanLBR' => true, 'allowCJKorphans' => true, 'allowCJKoverflow' => false, 'CJKforceend' => false, 'keepColumns' => false, 'max_colH_correction' => 1.1499999999999999, 'ColGap' => 5, 'list_auto_mode' => 'browser', 'list_indent_default' => '40px', 'list_indent_default_mpdf' => '0em', 'list_indent_first_level' => 0, 'list_number_suffix' => '.', 'list_marker_offset' => '5.5pt', 'list_symbol_size' => '3.6pt', 'SHYlanguages' => array('en', 'de', 'es', 'fi', 'fr', 'it', 'nl', 'pl', 'ru', 'sv'), 'SHYlang' => 'en', 'SHYleftmin' => 2, 'SHYrightmin' => 2, 'SHYcharmin' => 2, 'SHYcharmax' => 10, 'useActiveForms' => false, 'watermarkImgBehind' => false, 'showWatermarkText' => 0, 'showWatermarkImage' => 0, 'watermarkText' => '', 'watermarkAngle' => 45, 'watermarkImage' => '', 'watermark_font' => '', 'watermarkTextAlpha' => 0.20000000000000001, 'watermarkImageAlpha' => 0.20000000000000001, 'watermarkImgAlphaBlend' => 'Normal', 'autoPadding' => false, 'svgAutoFont' => false, 'svgClasses' => false, 'defaultCSS' => array('BODY' => array('FONT-FAMILY' => 'serif', 'FONT-SIZE' => '11pt', 'TEXT-INDENT' => '0pt', 'LINE-HEIGHT' => 'normal', 'MARGIN-COLLAPSE' => 'collapse', 'HYPHENS' => 'manual', 'FONT-KERNING' => 'auto'), 'P' => array('MARGIN' => '1.12em 0'), 'H1' => array('FONT-SIZE' => '2em', 'FONT-WEIGHT' => 'bold', 'MARGIN' => '0.67em 0', 'PAGE-BREAK-AFTER' => 'avoid'), 'H2' => array('FONT-SIZE' => '1.5em', 'FONT-WEIGHT' => 'bold', 'MARGIN' => '0.75em 0', 'PAGE-BREAK-AFTER' => 'avoid'), 'H3' => array('FONT-SIZE' => '1.17em', 'FONT-WEIGHT' => 'bold', 'MARGIN' => '0.83em 0', 'PAGE-BREAK-AFTER' => 'avoid'), 'H4' => array('FONT-WEIGHT' => 'bold', 'MARGIN' => '1.12em 0', 'PAGE-BREAK-AFTER' => 'avoid'), 'H5' => array('FONT-SIZE' => '0.83em', 'FONT-WEIGHT' => 'bold', 'MARGIN' => '1.5em 0', 'PAGE-BREAK-AFTER' => 'avoid'), 'H6' => array('FONT-SIZE' => '0.75em', 'FONT-WEIGHT' => 'bold', 'MARGIN' => '1.67em 0', 'PAGE-BREAK-AFTER' => 'avoid'), 'HR' => array('COLOR' => '#888888', 'TEXT-ALIGN' => 'center', 'WIDTH' => '100%', 'HEIGHT' => '0.2mm', 'MARGIN-TOP' => '0.83em', 'MARGIN-BOTTOM' => '0.83em'), 'PRE' => array('MARGIN' => '0.83em 0', 'FONT-FAMILY' => 'monospace'), 'S' => array('TEXT-DECORATION' => 'line-through'), 'STRIKE' => array('TEXT-DECORATION' => 'line-through'), 'DEL' => array('TEXT-DECORATION' => 'line-through'), 'SUB' => array('VERTICAL-ALIGN' => 'sub', 'FONT-SIZE' => '55%'), 'SUP' => array('VERTICAL-ALIGN' => 'super', 'FONT-SIZE' => '55%'), 'U' => array('TEXT-DECORATION' => 'underline'), 'INS' => array('TEXT-DECORATION' => 'underline'), 'B' => array('FONT-WEIGHT' => 'bold'), 'STRONG' => array('FONT-WEIGHT' => 'bold'), 'I' => array('FONT-STYLE' => 'italic'), 'CITE' => array('FONT-STYLE' => 'italic'), 'Q' => array('FONT-STYLE' => 'italic'), 'EM' => array('FONT-STYLE' => 'italic'), 'VAR' => array('FONT-STYLE' => 'italic'), 'SAMP' => array('FONT-FAMILY' => 'monospace'), 'CODE' => array('FONT-FAMILY' => 'monospace'), 'KBD' => array('FONT-FAMILY' => 'monospace'), 'TT' => array('FONT-FAMILY' => 'monospace'), 'SMALL' => array('FONT-SIZE' => '83%'), 'BIG' => array('FONT-SIZE' => '117%'), 'ACRONYM' => array('FONT-SIZE' => '77%', 'FONT-WEIGHT' => 'bold'), 'ADDRESS' => array('FONT-STYLE' => 'italic'), 'BLOCKQUOTE' => array('MARGIN-LEFT' => '40px', 'MARGIN-RIGHT' => '40px', 'MARGIN-TOP' => '1.12em', 'MARGIN-BOTTOM' => '1.12em'), 'A' => array('COLOR' => '#0000FF', 'TEXT-DECORATION' => 'underline'), 'UL' => array('PADDING' => '0 auto', 'MARGIN-TOP' => '0.83em', 'MARGIN-BOTTOM' => '0.83em'), 'OL' => array('PADDING' => '0 auto', 'MARGIN-TOP' => '0.83em', 'MARGIN-BOTTOM' => '0.83em'), 'DL' => array('MARGIN' => '1.67em 0'), 'DT' => array(), 'DD' => array('PADDING-LEFT' => '40px'), 'TABLE' => array('MARGIN' => '0', 'BORDER-COLLAPSE' => 'separate', 'BORDER-SPACING' => '2px', 'EMPTY-CELLS' => 'show', 'LINE-HEIGHT' => '1.2', 'VERTICAL-ALIGN' => 'middle', 'HYPHENS' => 'manual', 'FONT-KERNING' => 'auto'), 'THEAD' => array(), 'TFOOT' => array(), 'TH' => array('FONT-WEIGHT' => 'bold', 'TEXT-ALIGN' => 'center', 'PADDING-LEFT' => '0.1em', 'PADDING-RIGHT' => '0.1em', 'PADDING-TOP' => '0.1em', 'PADDING-BOTTOM' => '0.1em'), 'TD' => array('PADDING-LEFT' => '0.1em', 'PADDING-RIGHT' => '0.1em', 'PADDING-TOP' => '0.1em', 'PADDING-BOTTOM' => '0.1em'), 'CAPTION' => array('TEXT-ALIGN' => 'center'), 'IMG' => array('MARGIN' => '0', 'VERTICAL-ALIGN' => 'baseline', 'IMAGE-RENDERING' => 'auto'), 'INPUT' => array('FONT-FAMILY' => 'sans-serif', 'VERTICAL-ALIGN' => 'middle', 'FONT-SIZE' => '0.9em'), 'SELECT' => array('FONT-FAMILY' => 'sans-serif', 'FONT-SIZE' => '0.9em', 'VERTICAL-ALIGN' => 'middle'), 'TEXTAREA' => array('FONT-FAMILY' => 'monospace', 'FONT-SIZE' => '0.9em', 'VERTICAL-ALIGN' => 'text-bottom'), 'MARK' => array('BACKGROUND-COLOR' => 'yellow')), 'defaultCssFile' => '/var/www/html/laravel/vendor/mpdf/mpdf/src/Config/../../data/mpdf.css', 'customProperties' => array(), 'languageToFont' => object(LanguageToFont), 'scriptToLanguage' => object(ScriptToLanguage), 'pdf_version' => '1.4', 'fontDir' => array('/var/www/html/laravel/vendor/mpdf/mpdf/src/Config/../../ttfonts'), 'allowAnnotationFiles' => false, 'hyphenationDictionaryFile' => '/var/www/html/laravel/vendor/mpdf/mpdf/src/Config/../../data/patterns/dictionary.txt', 'default_lineheight_correction' => 1.2, 'fontsizes' => array('XX-SMALL' => 0.69999999999999996, 'X-SMALL' => 0.77000000000000002, 'SMALL' => 0.85999999999999999, 'MEDIUM' => 1, 'LARGE' => 1.2, 'X-LARGE' => 1.5, 'XX-LARGE' => 2), 'pregRTLchars' => '\\x{0590}-\\x{06FF}\\x{0700}-\\x{085F}\\x{FB00}-\\x{FDFD}\\x{FE70}-\\x{FEFF}', 'pregCJKchars' => '\\x{1100}-\\x{11FF}\\x{2E80}-\\x{A4CF}\\x{A800}-\\x{D7AF}\\x{F900}-\\x{FAFF}\\x{FE30}-\\x{FE6F}\\x{FF00}-\\x{FFEF}\\x{20000}-\\x{2FA1F}', 'CJKleading' => '$\\(\\*\\[\\{\\x{00a3}\\x{00a5}\\x{00ab}\\x{00b7}\\x{2018}\\x{201c}\\x{2035}\\x{3005}\\x{3007}\\x{3008}\\x{300a}\\x{300c}\\x{300e}\\x{3010}\\x{3014}\\x{3016}\\x{3018}\\x{301d}\\x{fe34}\\x{fe35}\\x{fe37}\\x{fe39}\\x{fe3b}\\x{fe3d}\\x{fe3f}\\x{fe41}\\x{fe43}\\x{fe57}\\x{fe59}\\x{fe5b}\\x{fe5d}\\x{ff04}\\x{ff08}\\x{ff0e}\\x{ff3b}\\x{ff5b}\\x{ff5f}\\x{ff62}\\x{ffe1}\\x{ffe5}\\x{ffe6}', 'CJKfollowing' => '!%\\),\\.:,>\\?\\]\\}\\x{00a2}\\x{00a8}\\x{00b0}\\x{00b7}\\x{00bb}\\x{02c7}\\x{02c9}\\x{2010}\\x{2013}-\\x{2016}\\x{2019}\\x{201d}-\\x{201f}\\x{2020}-\\x{2022}\\x{2025}-\\x{2027}\\x{2030}\\x{2032}\\x{2033}\\x{203a}\\x{203c}\\x{2047}-\\x{2049}\\x{2103}\\x{2236}\\x{2574}\\x{3001}-\\x{3003}\\x{3005}\\x{3006}\\x{3009}\\x{300b}\\x{300d}\\x{300f}\\x{3011}\\x{3015}\\x{3017}\\x{3019}\\x{301c}\\x{301e}\\x{301f}\\x{303b}\\x{3041}\\x{3043}\\x{3045}\\x{3047}\\x{3049}\\x{3063}\\x{3083}\\x{3085}\\x{3087}\\x{308e}\\x{3095}\\x{3096}\\x{309b}-\\x{309e}\\x{30a0}\\x{30a1}\\x{30a3}\\x{30a5}\\x{30a7}\\x{30a9}\\x{30c3}\\x{30e3}\\x{30e5}\\x{30e7}\\x{30ee}\\x{30f5}\\x{30f6}\\x{30fb}-\\x{30fd}\\x{30fe}\\x{31f0}-\\x{31ff}\\x{fe30}\\x{fe31}-\\x{fe34}\\x{fe36}\\x{fe38}\\x{fe3a}\\x{fe3c}\\x{fe3e}\\x{fe40}\\x{fe42}\\x{fe44}\\x{fe4f}\\x{fe50}-\\x{fe58}\\x{fe5a}\\x{fe5c}-\\x{fe5e}\\x{ff01}\\x{ff02}\\x{ff05}\\x{ff07}\\x{ff09}\\x{ff0c}\\x{ff0e}\\x{ff1a}\\x{ff1b}\\x{ff1f}\\x{ff3d}\\x{ff40}\\x{ff5c}-\\x{ff5e}\\x{ff60}\\x{ff61}\\x{ff63}-\\x{ff65}\\x{ff9e}\\x{ff9f}\\x{ffe0}', 'CJKoverflow' => '\\.,\\x{ff61}\\x{ff64}\\x{3001}\\x{3002}\\x{fe50}-\\x{fe52}\\x{ff0c}\\x{ff0e}', 'pregCURSchars' => '\\x{0590}-\\x{083E}\\x{0900}-\\x{0DFF}\\x{FB00}-\\x{FDFD}\\x{FE70}-\\x{FEFF}', 'allowedCSStags' => 'DIV|P|H1|H2|H3|H4|H5|H6|FORM|IMG|A|BODY|TABLE|HR|THEAD|TFOOT|TBODY|TH|TR|TD|UL|OL|LI|PRE|BLOCKQUOTE|ADDRESS|DL|DT|DD|ARTICLE|ASIDE|FIGURE|FIGCAPTION|FOOTER|HEADER|HGROUP|NAV|SECTION|MAIN|MARK|DETAILS|SUMMARY|METER|PROGRESS|TIME|SPAN|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|STRIKE|S|U|DEL|INS|Q|FONT|SELECT|INPUT|TEXTAREA|CAPTION|FIELDSET|LEGEND|TEXTCIRCLE|DOTTAB|BDO|BDI', 'outerblocktags' => array('DIV', 'FORM', 'CENTER', 'DL', 'FIELDSET', 'ARTICLE', 'ASIDE', 'FIGURE', 'FIGCAPTION', 'FOOTER', 'HEADER', 'HGROUP', 'MAIN', 'NAV', 'SECTION', 'DETAILS', 'SUMMARY', 'UL', 'OL', 'LI'), 'innerblocktags' => array('P', 'BLOCKQUOTE', 'ADDRESS', 'PRE', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'DT', 'DD', 'CAPTION'), 'curlFollowLocation' => false, 'curlAllowUnsafeSslRequests' => false, 'curlTimeout' => 5))

in Controller_strona.php line 60
at Controller_strona->generate_pdf()
at call_user_func_array(array(object(Controller_strona), 'generate_pdf'), array())
in Controller.php line 55
at Controller->callAction('generate_pdf', array())
in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(Controller_strona), 'generate_pdf')
in Route.php line 203
at Route->runController()
in Route.php line 160
at Route->run()
in Router.php line 572
at Router->Illuminate\Routing\{closure}(object(Request))
in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure))
in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure))
in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure))
in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in Pipeline.php line 102
at Pipeline->then(object(Closure))
in Router.php line 574
at Router->runRouteWithinStack(object(Route), object(Request))
in Router.php line 533
at Router->dispatchToRoute(object(Request))
in Router.php line 511
at Router->dispatch(object(Request))
in Kernel.php line 176
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure))
in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure))
in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in ValidatePostSize.php line 27
at ValidatePostSize->handle(object(Request), object(Closure))
in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in Pipeline.php line 102
at Pipeline->then(object(Closure))
in Kernel.php line 151
at Kernel->sendRequestThroughRouter(object(Request))
in Kernel.php line 116
at Kernel->handle(object(Request))
in index.php line 53

答案 1 :(得分:0)

文件的所有权可能引起问题。您文件的组所有权可能设置为“根”,因此您必须将其更改为“ www-data”

这是我通常做的...

chown -R root:www-data {your_file}

希望能解决问题