I have a problem, I cannot solve. Maybe you can help?
- I switched to a new vHost, where I use Plesk Obsidian, to manage it.
- On the old server I successfully delopeyed a Symfony 5 project. The
project is store inside a github repository (except the local data).
So on changing to the new server I did the following:
- I checked out the git project via ssh on the new server.
- I installed id with composer install and updated all packages with composer update
- I added the old database and enabled dev environment for testing.
- I added a new subdomain in Plesk, pointing to the public directory of the symfony project.
- I added a .htaccess file to the public directory, with following content:
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /index.php/
</IfModule>
</IfModule>
Now on accessing the subdomain, The default page loads. But on accessing a subpage, I get the following error:
Class "1PageController" does not exist in /var/www/vhosts/xx/xx/config/routes/../../src/Controller/ (which is being imported from "/var/www/vhosts/xx/xx/config/routes/annotations.yaml"). Make sure annotations are installed and enabled
2
Answers
The solution was
maybe that I've installed the plesk plugin, wich is still composer 1.* and not the latest, was the problem. no everything works fine.
Maybe it’s not that at all, but I had the same problem using InteliJ IDE because when you reformat your controllers, it delete the import of Anotations from the file.
Maybe it will help.