2016-04-14 19 views
6

मैंने लैरवेल परियोजना के साथ काम करने से पहले सामान्य रूप से संगीतकार इंस्टॉल और संगीतकार अद्यतन चलाने की कोशिश की। हालांकि मुझे एक अजीब मुद्दा सामने आया कि मैं थोड़ी देर के लिए हल नहीं कर सकता।लैरवेल 4.2 - संगीतकार अद्यतन समस्या

PHP Fatal error: Uncaught exception 'ErrorException' with message 'Invalid argument supplied for foreach()' in /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7:35 
Stack trace: 
#0 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7(35): Illuminate\Exception\Handler->handleError(2, 'Invalid argumen...', '/Applications/X...', 35, Array) 
#1 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(35): include('/Applications/X...') 
#2 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/Applications/X...', Array) 
#3 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/framework/src/Illuminate/View/View.php(134): Illuminate\View\Engines\CompilerEngine->get('/Applications/X...', Array) 
#4 /Applications/XAMPP/xamppfiles/htdocs/ in /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7 on line 35 
PHP Fatal error: Uncaught exception 'ErrorException' with message 'Invalid argument supplied for foreach()' in /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7:35 
Stack trace: 
#0 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7(35): Illuminate\Exception\Handler->handleError(2, 'Invalid argumen...', '/Applications/X...', 35, Array) 
#1 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(35): include('/Applications/X...') 
#2 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/Applications/X...', Array) 
#3 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/framework/src/Illuminate/View/View.php(134): Illuminate\View\Engines\CompilerEngine->get('/Applications/X...', Array) 
#4 /Applications/XAMPP/xamppfiles/htdocs/ in /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7 on line 35 
Script php artisan clear-compiled handling the post-update-cmd event returned with an error 


    [RuntimeException]               
    Error Output: PHP Fatal error: Uncaught exception 'ErrorException' with me 
    ssage 'Invalid argument supplied for foreach()' in /Applications/XAMPP/xamp 
    pfiles/htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de 
    3dc7:35                  
    Stack trace:                 
    #0 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d 
    4682a7a7da163c9444d69f6b6de3dc7(35): Illuminate\Exception\Handler->handleEr 
    ror(2, 'Invalid argumen...', '/Applications/X...', 35, Array)     
    #1 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/fram 
    ework/src/Illuminate/View/Engines/PhpEngine.php(35): include('/Applications 
    /X...')                  
    #2 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/fram 
    ework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\E 
    ngines\PhpEngine->evaluatePath('/Applications/X...', Array)     
    #3 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/fram 
    ework/src/Illuminate/View/View.php(134): Illuminate\View\Engines\CompilerEn 
    gine->get('/Applications/X...', Array)          
    #4 /Applications/XAMPP/xamppfiles/htdocs/ in /Applications/XAMPP/xamppfiles 
    /htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7 o 
    n line 35                  
    PHP Fatal error: Uncaught exception 'ErrorException' with message 'Invalid 
    argument supplied for foreach()' in /Applications/XAMPP/xamppfiles/htdocs/ 
    wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7:35   
    Stack trace:                 
    #0 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d 
    4682a7a7da163c9444d69f6b6de3dc7(35): Illuminate\Exception\Handler->handleEr 
    ror(2, 'Invalid argumen...', '/Applications/X...', 35, Array)     
    #1 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/fram 
    ework/src/Illuminate/View/Engines/PhpEngine.php(35): include('/Applications 
    /X...')                  
    #2 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/fram 
    ework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\E 
    ngines\PhpEngine->evaluatePath('/Applications/X...', Array)     
    #3 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/fram 
    ework/src/Illuminate/View/View.php(134): Illuminate\View\Engines\CompilerEn 
    gine->get('/Applications/X...', Array)          
    #4 /Applications/XAMPP/xamppfiles/htdocs/ in /Applications/XAMPP/xamppfiles 
    /htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7 o 
    n line 35            

इस मुद्दे googling के बाद, मैं निम्नलिखित समाधान की कोशिश की लेकिन उनमें से कोई भी काम किया:

  1. vendor फ़ोल्डर और composer.lock को हटाने और फिर composer install
  2. चल bootstrap/compiled.php को हटाने और फिर composer update
  3. चल निर्देशिका को खाली करने के लिए php artisan cache:clear या php artisan views:clear चला रहा है। php artisan भी काम नहीं करता है
  4. मैं मैन्युअल storage/views को दूर करने की कोशिश की लेकिन यह भी --no-स्क्रिप्ट
  5. संगीतकार अपडेट विफल।

मैंने फ़ोल्डर की अनुमति 777 में बदल दी है, अगर यह एक अनुमति समस्या थी, लेकिन यह भी असफल रहा।

यहाँ सिर्फ मामले में composer.json है:

{ 
    "name": "laravel/laravel", 
    "description": "The Laravel Framework.", 
    "keywords": ["framework", "laravel"], 
    "license": "MIT", 
    "require": { 
     "laravel/framework": "4.2.7" 
    }, 
    "autoload": { 
     "classmap": [ 
      "app/commands", 
      "app/controllers", 
      "app/models", 
      "app/database/migrations", 
      "app/database/seeds", 
      "app/tests/TestCase.php" 
     ] 
    }, 
    "scripts": { 
     "post-install-cmd": [ 
      "php artisan clear-compiled", 
      "php artisan optimize" 
     ], 
     "post-update-cmd": [ 
      "php artisan clear-compiled", 
      "php artisan optimize" 
     ], 
     "post-create-project-cmd": [ 
      "php artisan key:generate" 
     ] 
    }, 
    "config": { 
     "preferred-install": "dist" 
    }, 
    "minimum-stability": "stable" 
} 

अद्यतन:

तो मैं त्रुटि मैं storage/views से हो रही थी अनुरेखण पहले foreach पाश में यह पता लगाने के लिए रखा:

<div class="sub-menu"> 
    @foreach($_destinationsList as $destination) 
     <ul> 
     <li> 
     <a href="{{_url('destination/'.$destination->slug)}}">{{$destination->{_en('name')._ar('name_ar')} }}</a> 
     </li> 
     @foreach($destination->children as $destination) 
     <li> 
     <a href="{{_url('destination/'.$destination->slug)}}">{{$destination->{_en('name')._ar('name_ar')} }}</a> 
     </li> 
     @endforeach 
     </ul> 
    @endforeach 
</div> 

उसमें जोड़कर मुझे url से पहले का कार्य मिलता है _ जो मुझे याद है कि लैरवेल 4.2 वहां नहीं था, आप बस url('url here') लिखते हैं। इसके अलावा en और ar एक ही समस्या का पालन करें। पहले foreach लूप Invalid argument supplied for foreach बताते रहें, जो अजीब है क्योंकि मैं डेटाबेस को माइग्रेट करने या यहां तक ​​कि बीज करने के लिए php artisan का उपयोग नहीं कर सकता।

और अजीब बात यह है कि वही कोड वर्तमान में रहता है और सामान्य रूप से काम करता है।

कोई विचार यहां समस्या क्या हो सकती है ?!

+0

क्या आपने ऐप/स्टोरेज/दृश्यों में सबकुछ मैन्युअल रूप से हटाने का प्रयास किया था? – aynber

+0

@aynber yes मैंने – omarsafwany

+0

किया है यदि आप अपने आईडीई में कोई प्रोजेक्ट खोलते हैं, तो क्या आप प्रोजेक्ट फ़ोल्डर स्टैक में किसी त्रुटि की तरह रेखांकित कुछ देखते हैं? – Norgul

उत्तर

0

हालांकि यह अजीब है, लेकिन मुझे त्रुटि मिली। डेटाबेस कॉन्फ़िगरेशन में host को localhost पर सेट किया गया था और कुछ अज्ञात कारणों से यह काम नहीं कर रहा था और उपरोक्त त्रुटियों को दे रहा था। मैंने इसे 127.0.0.1 में बदल दिया और यह सामान्य रूप से काम करता था।

मैं वास्तविक कारण नहीं समझ सकता क्योंकि त्रुटि ट्रेस में इस हिस्से से संबंधित कुछ भी नहीं है।

0

क्या आपने सुडो संगीतकार स्थापित/अपडेट करने का प्रयास किया है? मेरे पास आज भी इसी तरह के मुद्दे थे और इसे सूडो

+0

मैं हमेशा सुडो का उपयोग करके कमांड चलाता हूं, इसलिए अब तक यह काम नहीं कर रहा है – omarsafwany

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