2016-01-30 9 views
8

आज रात, मैंने composer install चलाने की कोशिश की और सभी निर्भरताओं को सही ढंग से स्थापित किया गया, और फिर संगीतकार php artisan clear compiled चला गया और मैं परेशानी में भाग गया। स्वाभाविक रूप सेलार्वा अनुमति अस्वीकार

> php artisan clear-compiled 


    [ErrorException]                           
    file_put_contents(/srv/something/site/bootstrap/cache/services.php): failed to open stream: No such file or directory 


Script php artisan clear-compiled handling the post-install-cmd event returned with an error 



    [RuntimeException] 
    Error Output:  



install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]... 

, मैं इसे googled और laracast forums निर्देशिका मैं याद आ रही थी बनाने के लिए कह रही है पर हर किसी को मिल गया है, तो मैंने किया था और आदेश भागा फिर से ठीक:

यहाँ त्रुटि यह वापस आ गया है। ,

ErrorException in Filesystem.php line 81: 
file_put_contents(/8ff8cea6e3bb10ecec87b9d62c64f9768c4c4ab1.php): failed to open stream: Permission denied 
in Filesystem.php line 81 
at HandleExceptions->handleError('2', 'file_put_contents(/8ff8cea6e3bb10ecec87b9d62c64f9768c4c4ab1.php): failed to open stream: Permission denied', '/srv/something/site/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php', '81', array('path' => '/8ff8cea6e3bb10ecec87b9d62c64f9768c4c4ab1.php', 'contents' => '<?php $__env->startSection('title'); ?> Admin Login <?php $__env->stopSection(); ?> <?php $__env->startSection('form'); ?> <form class="form-horizontal" method="POST" action = "login"> <?php echo e($error); ?><?php /*TODO this doesn't show up now, when you do login make it show up*/ ?> <fieldset> <!-- Form Name --> <h1 class="section-heading" style="text-align: center;">Login</h1> <!-- Text input--> <div class="form-group"> <label class="col-md-4 control-label" for="email">Email</label> <div class="col-md-4"> <input id="email" name="email" type="email" id = "email" placeholder="[email protected]" class="form-control input-md" required=""> </div> </div> <!-- Password input--> <div class="form-group"> <label class="col-md-4 control-label" for="password">Password</label> <div class="col-md-4"> <input id="password" name="password" type="password" placeholder="********" class="form-control input-md" required=""> </div> </div> <!-- Button --> <div class="form-group"> <label class="col-md-4 control-label" for="Submit"></label> <div class="col-md-4"> <button id="submit" name="submit" class="btn btn-primary">Submit</button> </div> </fieldset> </form> <?php $__env->stopSection(); ?> <?php $__env->startSection('message'); ?> <p class="text-muted" style="text-align:center">Don't have an account yet? Click <a href="../register">here</a> to register.</p> <?php $__env->stopSection(); ?> <?php echo $__env->make('auth.partials.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>', 'lock' => false)) 
at file_put_contents('/8ff8cea6e3bb10ecec87b9d62c64f9768c4c4ab1.php', '<?php $__env->startSection('title'); ?> Admin Login <?php $__env->stopSection(); ?> <?php $__env->startSection('form'); ?> <form class="form-horizontal" method="POST" action = "login"> <?php echo e($error); ?><?php /*TODO this doesn't show up now, when you do login make it show up*/ ?> <fieldset> <!-- Form Name --> <h1 class="section-heading" style="text-align: center;">Login</h1> <!-- Text input--> <div class="form-group"> <label class="col-md-4 control-label" for="email">Email</label> <div class="col-md-4"> <input id="email" name="email" type="email" id = "email" placeholder="[email protected]" class="form-control input-md" required=""> </div> </div> <!-- Password input--> <div class="form-group"> <label class="col-md-4 control-label" for="password">Password</label> <div class="col-md-4"> <input id="password" name="password" type="password" placeholder="********" class="form-control input-md" required=""> </div> </div> <!-- Button --> <div class="form-group"> <label class="col-md-4 control-label" for="Submit"></label> <div class="col-md-4"> <button id="submit" name="submit" class="btn btn-primary">Submit</button> </div> </fieldset> </form> <?php $__env->stopSection(); ?> <?php $__env->startSection('message'); ?> <p class="text-muted" style="text-align:center">Don't have an account yet? Click <a href="../register">here</a> to register.</p> <?php $__env->stopSection(); ?> <?php echo $__env->make('auth.partials.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>', '0') in Filesystem.php line 81 
at Filesystem->put('/8ff8cea6e3bb10ecec87b9d62c64f9768c4c4ab1.php', '<?php $__env->startSection('title'); ?> Admin Login <?php $__env->stopSection(); ?> <?php $__env->startSection('form'); ?> <form class="form-horizontal" method="POST" action = "login"> <?php echo e($error); ?><?php /*TODO this doesn't show up now, when you do login make it show up*/ ?> <fieldset> <!-- Form Name --> <h1 class="section-heading" style="text-align: center;">Login</h1> <!-- Text input--> <div class="form-group"> <label class="col-md-4 control-label" for="email">Email</label> <div class="col-md-4"> <input id="email" name="email" type="email" id = "email" placeholder="[email protected]" class="form-control input-md" required=""> </div> </div> <!-- Password input--> <div class="form-group"> <label class="col-md-4 control-label" for="password">Password</label> <div class="col-md-4"> <input id="password" name="password" type="password" placeholder="********" class="form-control input-md" required=""> </div> </div> <!-- Button --> <div class="form-group"> <label class="col-md-4 control-label" for="Submit"></label> <div class="col-md-4"> <button id="submit" name="submit" class="btn btn-primary">Submit</button> </div> </fieldset> </form> <?php $__env->stopSection(); ?> <?php $__env->startSection('message'); ?> <p class="text-muted" style="text-align:center">Don't have an account yet? Click <a href="../register">here</a> to register.</p> <?php $__env->stopSection(); ?> <?php echo $__env->make('auth.partials.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>') in BladeCompiler.php line 102 
at BladeCompiler->compile('/srv/something/site/resources/views/auth/login.blade.php') in CompilerEngine.php line 51 
at CompilerEngine->get('/srv/something/site/resources/views/auth/login.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'error' => '')) in View.php line 135 
at View->getContents() in View.php line 106 
at View->renderContents() in View.php line 80 
at View->render() in Response.php line 53 
at Response->setContent(object(View)) in Response.php line 197 
at Response->__construct(object(View)) in Router.php line 1030 
at Router->prepareResponse(object(Request), object(View)) in ControllerDispatcher.php line 95 
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52 
at Pipeline->Illuminate\Routing\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103 
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 96 
at ControllerDispatcher->callWithinStack(object(authController), object(Route), object(Request), 'getAdminLogin') in ControllerDispatcher.php line 54 
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\authController', 'getAdminLogin') in Route.php line 174 
at Route->runController(object(Request)) in Route.php line 140 
at Route->run(object(Request)) in Router.php line 703 
at Router->Illuminate\Routing\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52 
at Pipeline->Illuminate\Routing\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103 
at Pipeline->then(object(Closure)) in Router.php line 705 
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 678 
at Router->dispatchToRoute(object(Request)) in Router.php line 654 
at Router->dispatch(object(Request)) in Kernel.php line 246 
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52 
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44 
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) 
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 
at Pipeline->Illuminate\Routing\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103 
at Pipeline->then(object(Closure)) in Kernel.php line 132 
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99 
at Kernel->handle(object(Request)) in index.php line 54 

अभी तक यह मेरे द्वारा की गई ठीक करने के लिए निम्न का प्रयास करें: file_put_contents(/differentNameDependingOnPageButAlwaysRandomLettersAndNumbers.php): failed to open stream: Permission denied

उदाहरण के लिए यहां प्रवेश पृष्ठ के लिए ट्रैस है:

जब मैं किसी भी पृष्ठ के लिए गया था मैं यह मिल गया
  1. की जाँच की अनुमति, सब कुछ 777 करने और www-data
  2. कोई विक्रेता फ़ाइल के साथ खाली भंडार recloning की कोशिश की द्वारा स्वामित्व के लिए, एक ही त्रुटि संगीतकार पर में बदल कोई लाभ नहीं हुआ रोकने
  3. Ran php artisan cache:clear
  4. Ran php artisan clear-compiled
  5. php artisan dump-autoload
  6. संशोधित site/config/view.php Ran एक irc सुझाव पर, और बदल compiled' => realpath(storage_path().'/framework/views')'compiled' => storage_path('framework/views'), को जो एक अलग त्रुटि झुकेंगे: file_put_contents(/srv/something/site/storage/framework/views/8ff8cea6e3bb10ecec87b9d62c64f9768c4c4ab1.php): failed to open stream: No such file or directory (शायद इसलिए कि यह वहाँ होना चाहिए नहीं कर रहा है, लेकिन जो जानता है कि यह जानकारी उपयोगी हो सकती है।)

यह सब कोई फायदा नहीं हुआ। अजीब हिस्सा यह मुद्दा कहीं भी दिखाई नहीं दे रहा है। सहायता के लिए धन्यवाद!

+2

नीचे दिए गए आदेश के साथ एप्लिकेशन फ़ोल्डर को अनब्लॉक किया जा सकता है, यह स्पष्ट रूप से अनुमति अनुमति समस्या प्रतीत होता है। मुझे पता है कि आपने कहा था कि आपने '777' को ध्वस्त कर दिया है, लेकिन आपने यह कहां किया? मैं आगे बढ़ूंगा और भंडारण निर्देशिका पर रिकर्सिव 777 का प्रयास करूंगा: 'chmod -R 777 स्टोरेज' – jpschroeder

+0

@jpschroeder मैंने कोशिश की कि इसका कोई फायदा नहीं हुआ, यहां मेरी लार्वा रूट और स्टोरेज निर्देशिका निर्देशिका का ls -l है: https: // git.io/vzxAE –

+2

आपका ls -l दिखाता है कि पूरी निर्देशिका रूट के स्वामित्व में है और स्टोरेज निर्देशिका लिखने योग्य नहीं है, इसलिए मुझे नहीं लगता कि आप अनुमतियों को सही तरीके से बदल रहे हैं। 'cd {laravel_root} 'और' सुडो चोउन -आर www-data: www-data।' sudo chmod -R 777 स्टोरेज ' – judereid

उत्तर

22

यह पता चला है कि मैं laravel_root/storage/ में एक व्यू निर्देशिका खो रहा था। आदेश में इस को ठीक करने के लिए, सब मुझे क्या करना था:

  1. cd {laravel_root}/storage
  2. mkdir -pv framework/views app framework/sessions framework/cache
  3. cd ..
  4. chmod 777 -R storage
  5. chown -R www-data:www-data storage

उसके बाद, फिर से लोड करने पर, मुद्दा तय था। इस समस्या को ठीक करने के लिए freenode परसे Someguy123 पर धन्यवाद!

+1

खुशी है कि आप इसे चलाने में सक्षम थे। यह अजीब बात है कि आपको उन निर्देशिकाओं को मैन्युअल रूप से बनाना था क्योंकि वे मूल [लार्वा रेपो] (https://github.com/laravel/laravel/tree/master/storage/framework) का हिस्सा हैं। क्या आपने इंस्टॉल करते समय 'संगीतकार निर्माण-प्रोजेक्ट' कमांड का उपयोग किया था? – jpschroeder

+0

@jpschroeder हाँ, यह समस्या गिट के साथ फाइलों को गलती से हटा रही थी। –

+2

777 सेट करना एक बुरी आदत है, समूह को अपने वेबसर्वर उपयोगकर्ता को सेट करने पर विचार करें और उस फ़ोल्डर में केवल उस समूह को लिखने की अनुमति दें। इस उत्तर को जांचें: http://stackoverflow.com/a/37266353/987864 – Daan

0

मैं था ही परेशानी एक नई परियोजना बनाने Git clone.Turns का उपयोग कर बाहर यह था, क्योंकि मैं था/भंडारण/रूपरेखा/विचारों/gitignore file.I पर बस mkdir storage/framework/views/ और sudo chown -R www-data:www-data storage और सब फिर से ठीक था के बाद किया गया था। उम्मीद है कि यह किसी की मदद करता है।

0

मैंने पाया आप एक डिफ़ॉल्ट के रूप में इस मिल है कि जब आप gitignore.io और Laravel में खींचने के लिए जाना

# Laravel 4 विशिष्ट बूटस्ट्रैप/संकलित।php एप्लिकेशन/भंडारण/

# Laravel 5 & लुमेन विशिष्ट बूटस्ट्रैप/कैश/ .env। *। php .env.php .env

मैं साधारण बस Laravel 5 में एक #bootstrap/cache जगह इसलिए जैसे अनुभाग:

Laravel 5 & लुमेन विशिष्ट

# बूटस्ट्रैप/कैश/ .env। *। Php .env.php .env

आशा है कि किसी की सहायता करें।

+0

आपको पहले फ़ोल्डरों को बनाना होगा हालांकि –

0

यदि आपकी अनुमतियां लैवेलवेल एप्लिकेशन फ़ोल्डर के लिए 777 हैं और अभी भी यह त्रुटि हो रही है, तो ऐसा इसलिए है क्योंकि सेलियक्स ने इसे अवरुद्ध कर दिया है।

su -c "chcon -R -h -t httpd_sys_script_rw_t /var/www/laravel-folder" 
+0

यदि आपके पास सेलीनिन (चेक /var/log/audit/audit.log) है और आप php को शामिल करने का प्रयास करते हैं - http रूट फ़ोल्डर के बाहर फाइलें, https://stackoverflow.com/questions/15395845/tell-selinux-to-give-apache-execute-access-to-php-files-outside-document-root देखें –

संबंधित मुद्दे