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

mathishuettl's avatar

Deploy to Hoster -> Php artisan doesn't work

Hello,

it's my first laravel application: I created a folder in /html/laravel and uplodated my laravel application and pointet the entrypoint of the domain to /html/laravel/public

when i connect with ssh (putty) to the server and i wanna run php artisan i get the following error:

[ErrorException] Invalid argument supplied for foreach()

Content-type: text/html; charset=UTF-8

0 likes
6 replies
oaj's avatar

Try php -v and check if you have somewhat similar php versions on the server and on your dev environment.

Also check if you have run composer install on the server (do you have the vendor directory? and the vendor/autoload.php file)

Snapey's avatar

You will need to post more of the error than just the headline.

Look in the laravel log for the specific error

mathishuettl's avatar

local i have version 7.0.13 and on the server i have 5.6.30 but i can't update the server because there are some apps that only runs on 5.6.30 how can i run laravel on this version?

oaj's avatar

Laravel 5.4 should run fine on PHP 5.6.4 and upwards

Also as @Snapey pointed out check the storage/logs/laravel.log for logged errors.

mathishuettl's avatar

When i want to run any php artisan command:

[2017-04-06 07:57:44] local.ERROR: exception 'ErrorException' with message 'Invalid argument supplied for foreach()' in /html/labor/vendor/symfony/console/Input/ArgvInput.php:284 Stack trace: #0 /html/labor/vendor/symfony/console/Input/ArgvInput.php(284): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'Invalid argumen...', '/html/labor/ven...', 284, Array) #1 /html/labor/vendor/symfony/console/Application.php(764): Symfony\Component\Console\Input\ArgvInput->hasParameterOption(Array, true) #2 /html/labor/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->configureIO(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #3 /html/labor/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(123): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #4 /html/labor/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #5 {main}

Please or to participate in this conversation.