Symfony - Webpage drops error after installing API-Platfrom
Tags: symfony, composer
Published: 2022-06-21 16:05:54

After I made it to install the [API-Platform](https://dev.to/jerdox/symfony-42-installing-api-platfrom-for-using-web-services-3fd7) and [create an entity with the maker-bundle](https://dev.to/jerdox/symfony-42-creating-an-entity-with-the-maker-bundle-and-migrate-it-30co) and also [updated Symfony](https://dev.to/jerdox/updating-symfony-42-to-44-i48) to version 4.4, I get an error when I open my webpage.

![Image of the 500 error message from the webbrowser](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r2fsm7x81ynp1ep5h6o9.png) 

And although that I activate the debugging mode, I don't get a proper error message, that's sucks....

In the passt I often getting a more detailed error message when by running:

`php bin/console clear:cache`

...and yes this time too. The error message said:

```
In FileLoader.php line 180: 
                                                                                                                                                                                                                                                                                                                          
  There is no builtin action for the collection GET operation. You need to define the controller yourself in . (which is being imported from "<path>\config/routes/api_platform.yaml"). Make sure there is a loader supporting the "api_platform" type.  
                                                                                                                                                                                                                                                                                                                 
In ApiLoader.php line 177:
                                                                                                            
  There is no builtin action for the collection GET operation. You need to define the controller yourself.  
```

I don't know where the problem comes from and this time googleing gets also no helpful links... 

So and now ???

I remember that I have updating Symfony the dependencies to the Symfony version 4.4. But the api-platform/core was not updated to a new version, it was still on version "2.1" 

So I decide to update this and all the other dependencies.

There for in my composer.json I changed the version of the api-platform/core from "2.1" to "**^**2.1" to let composer decide which version should be installed.

I save the file and run the command:

`composer update --with-all-dependencies`

As it runs it ends up with an error:

```
 Could not delete C:\Users\userap\Desktop\_Workspace\WebDevelopment\WebClient_2\dosierung\vendor/sensio/framework-extra-bundle\Resources\config:   
  This can be due to an antivirus or the Windows Search Indexer locking the file while they are analyzed
```

Okay the last sentence sounds plausible to me. Means that a service from Windows has just access the file in the moment when composer want to do some changes.

So no problem, I run it again and this time it works, perfect.

Composer has updated the api-platform/core to the version "2.6.8"

I open my webpage and...YES the 500 error is gone and my page was loading, lucky again.