'Deploy API Platform 2.6 and Symfony 5.4
I created a project with Api platform 2.6 & Symfony 5.4 and then I uploaded it with FileZilla (FTP).
I followed the step to deploy a Symfonyproject update composer packages and change database in .env. I sent the project online so that it would be avalaible on a domain name like my-website.com. The symfony part works well but when I try to reach "my-website.com/api" I get code 404 even if I a set env=prod I get the 404 page.
Is there any action to activate/start api platfrom after deploying online ? Thanks !
Solution 1:[1]
Thanks for your help everybody !
I found the solution. I was missing a htaccess file in the /public directory. I found one here : https://github.com/symfony/recipes-contrib/blob/main/symfony/apache-pack/1.0/public/.htaccess
And from now routes work fine ! I just have to take a look at the htaccess to check the content
Solution 2:[2]
You should try composer composer require symfony/apache-pack
if your web server is running Apache.
See also : https://symfony.com/doc/current/setup/web_server_configuration.html
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Neiluj |
Solution 2 | Glukose |