Magento2 file_put_contents

问题描述 投票:0回答:1

我刚刚安装(上传)了一个新的扩展到我的Magento2商店,然而在编译和部署后,我不断地遇到以下错误。

    1 exception(s):
    Exception #0 (Exception): Warning: file_put_contents(/var/www/html/pub/static/frontend/smart_media/smart_media1/th_TH/css/themes.css): failed to open stream: No such file or directory in /var/www/html/vendor/oyejorge/less.php/lessc.inc.php on line 177

    Exception #0 (Exception): Warning: file_put_contents(/var/www/html/pub/static/frontend/smart_media/smart_media1/th_TH/css/themes.css): failed to open stream: No such file or directory in /var/www/html/vendor/oyejorge/less.php/lessc.inc.php on line 177
    #0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'file_put_conten...', '/var/www/html/v...', 177, Array)
    #1 /var/www/html/vendor/oyejorge/less.php/lessc.inc.php(177): file_put_contents('/var/www/html/p...', '/* Less Variabl...')
    #2 /var/www/html/app/code/Rokanthemes/Themeoption/Observer/RefreshStyleObserver.php(58): lessc->compileFile('/var/www/html/a...', '/var/www/html/p...')
    #3 /var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Rokanthemes\Themeoption\Observer\RefreshStyleObserver->execute(Object(Magento\Framework\Event\Observer))
    #4 /var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Rokanthemes\Themeoption\Observer\RefreshStyleObserver), Object(Magento\Framework\Event\Observer))
    #5 /var/www/html/vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))
    #6 /var/www/html/generated/code/Magento/Framework/Event/Manager/Proxy.php(95): Magento\Framework\Event\Manager->dispatch('layout_generate...', Array)
    #7 /var/www/html/vendor/magento/framework/View/Layout/Builder.php(134): Magento\Framework\Event\Manager\Proxy->dispatch('layout_generate...', Array)
    #8 /var/www/html/vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
    #9 /var/www/html/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
    #10 /var/www/html/vendor/magento/framework/View/Layout.php(254): Magento\Framework\View\Layout\Builder->build()
    #11 /var/www/html/vendor/magento/framework/View/Layout.php(876): Magento\Framework\View\Layout->build()
    #12 /var/www/html/vendor/magento/module-cms/Helper/Page.php(171): Magento\Framework\View\Layout->getBlock('page_content_he...')
    #13 /var/www/html/vendor/magento/module-cms/Controller/Index/Index.php(43): Magento\Cms\Helper\Page->prepareResultPage(Object(Magento\Cms\Controller\Index\Index\Interceptor), 'home')
    #14 /var/www/html/vendor/magento/framework/App/Action/Action.php(107): Magento\Cms\Controller\Index\Index->execute()
    #15 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
    #16 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Cms\Controller\Index\Index\Interceptor->___callParent('dispatch', Array)
    #17 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Cms\Controller\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
    #18 /var/www/html/generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php(26): Magento\Cms\Controller\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array)
    #19 /var/www/html/vendor/magento/framework/App/FrontController.php(55): Magento\Cms\Controller\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
    #20 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
    #21 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
    #22 /var/www/html/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
    #23 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #24 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
    #25 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #26 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
    #27 /var/www/html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
    #28 /var/www/html/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
    #29 /var/www/html/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
    #30 /var/www/html/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
    #31 {main}

我已经搜索了许多解决方案,尝试修复权限,重新部署静态内容,删除生成的文件夹,改变权限等,但没有用。如果能得到一些专家的见解,我将非常感激。非常感谢您

magento2
1个回答
0
投票

听起来可能是它试图写入的目录目标(smart_media/smart_media1/th_TH/css)不存在。您可能需要修改扩展,使它能在 在尝试写入目录之前,先创建目录。.

© www.soinside.com 2019 - 2024. All rights reserved.