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

voksler's avatar

Artisan not working after updating PHP

Hi, I have been working on a local project using Laravel 5.2 with PHP 5.5.* version. Now I installed the 5.6.1 and the 7.1.9 PHP versions. When i try to start my project using the command "php artisan serve" i obtain the following error:


[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Collective\Html\HtmlServiceProvider' not found

I should mention that i already added "Collective\Html\HtmlServiceProvider::class," and


'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,

to the app.php file when i was working with the php 5.5.* version.

Best regards.

0 likes
10 replies
Lke's avatar

try first an :


service apache2 restart

Or any similar command depending on your OS:

then on your Laravel folder :

composer dump-autoload

hope it helps.

1 like
Snapey's avatar
Snapey
Best Answer
Level 122

have you installed the Collective package (not just referenced it in app.php

2 likes
ejdelmonico's avatar

Last time I checked (right now), there was not a compatible Collective package for 5.5...only 5.4 and below.

1 like
voksler's avatar

hi, thank you all for the answers, @Lke dump-autoload didn't resolved the problem, @Snapey I guess the collective package is installed as everything was working fine before i change the php version, @ejdelmonico i'm using laravel 5.2 Thank you all again

somnathsah's avatar

Run the below command after running composer. This might work

php artisan optimize
1 like
voksler's avatar

thank you @somnathsah but actually artisan is not working, i get the same error cited above when executing php artisan optimize

somnathsah's avatar

I think this library is missing so you can try installing this by bellow command

composer require laravelcollective/html
1 like
Snapey's avatar

List the complete error message please. Not just your summary.

voksler's avatar

@Snapey it was the only error code. Actually, installing collective package resolved the problem, as @Snapey and @somnathsah mentionned earlier, thank you guys. Can you please explain to me if it's possible why it was necessary to update the collective package after changing the php version ? (because artisan was working before changing the php version)

Please or to participate in this conversation.