Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ewill2017's avatar

Call to undefined method Laravel\Section::_start()

Im moving a Laravel App to another server, and did this:

  1. copied everythig to the new server
  2. updated the database.php file
  3. change all ocurrrencies of yield to _yield

But now Im stock with a "Server Error: 500 (Internal Server Error)"

Checking error_log: PHP Fatal error: Call to undefined method Laravel\Section::_start() in /home3/l7o1c5g8/public_html/laravel/view.php(366) : eval()'d code on line 264

No idea what to do now. How can I fix this?

Using Laravel 5.4 in a Shared Hosting.

0 likes
11 replies
Robstar's avatar

Try clearing your view cache: php artisan view:clear.

In these situations it's always worthwhile running a command along the lines of the following too:

php artisan cache:clear && php artisan clear-compiled && php artisan config:cache && php artisan route:cache && php artisan optimize

Snapey's avatar

change all ocurrrencies of yield to _yield

????????

Ewill2017's avatar

yield is now a reserved word in php, so we cant use it on our code. Laravel still uses it..so you must manually change it or your app wont work.

36864's avatar

Quick google search reveals Laravel 3.2.3 required PHP 5.3. From 5.3 to 5.6, there were more changes than just the addition of the yield keyword.

I'd suggest starting at http://php.net/manual/en/migration54.php and working forward to 5.6.

This may not be a trivial process.

Alternatively, migrate the project to a modern laravel verison.

I don't know which of these solutions would be easier or require less time, but I'd say neither of them will be trivial.

If time is a factor for you, find a server running the same php version that was running on the old server.

Ewill2017's avatar

How can I check what version of laravel Im using?

36864's avatar

Run php artisan -V.

Alternatively, check your composer.json file.

Ewill2017's avatar

After a long weekend fighting with laravel, I founf where to turn on the logs and display errors. And this is what it shows:

Unhandled Exception

Message:

mcrypt_encrypt(): Key of size 22 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported Location:

/home3/l7o1c5g8/public_html/laravel/crypter.php on line 40 Stack Trace:

#0 /home3/l7o1c5g8/public_html/laravel/laravel.php(40): Laravel\Error::native(2, 'mcrypt_encrypt(...', '/home3/l7o1c5g8...', 40) #1 [internal function]: Laravel{closure}(2, 'mcrypt_encrypt(...', '/home3/l7o1c5g8...', 40, Array) #2 /home3/l7o1c5g8/public_html/laravel/crypter.php(40): mcrypt_encrypt('rijndael-256', 'YourSecretKeyGo...', 'a:3:{s:2:"id";s...', 'cbc', '5E\x9B ]\xBE\x97Yb\x98J\xD7|\xCA\x90...') #3 /home3/l7o1c5g8/public_html/laravel/session/drivers/cookie.php(40): Laravel\Crypter::encrypt('a:3:{s:2:"id";s...') #4 /home3/l7o1c5g8/public_html/laravel/session/payload.php(293): Laravel\Session\Drivers\Cookie->save(Array, Array, false) #5 [internal function]: Laravel\Session\Payload->save() #6 /home3/l7o1c5g8/public_html/laravel/session.php(150): call_user_func_array(Array, Array) #7 /home3/l7o1c5g8/public_html/laravel/laravel.php(193): Laravel\Session::__callStatic('save', Array) #8 /home3/l7o1c5g8/public_html/laravel/laravel.php(193): Laravel\Session::save() #9 /home3/l7o1c5g8/public_html/public/index.php(34): require('/home3/l7o1c5g8...') #10 {main}

***** any clue, should I need to regenerate an encrytpion code? how?

Ewill2017's avatar
Ewill2017
OP
Best Answer
Level 1

SOLVED: I changed the default key on /public_html/application/config/application.php

from: 'key' => 'YourSecretKeyGoesHere!',

to: 'key' => '32 characters!',

you must replace the default key with a 16,24 or 32 characters word.

Thank you for your help.

Please or to participate in this conversation.