I had checked https://symfony.com/doc/current/deployment.html#common-post-deployment-tasks
Instead of what I need to do with command line, I have done manually. For example - vendor files just copied from my local machine, cache cleared manually, using still .env file, because cannot set environment variables.
First time it page loaded, but on next load I got error
Attempted to load class "ContainerParametersResourceChecker" from namespace "Symfony\Component\DependencyInjection\Config". Did you forget a "use" statement for another namespace?
I think same error was before clearing the cache. Of course we cannot clear the cache on each page load.
Is it not possible to fix it permanently or if it is - how?
Stacktrace:
Symfony\Component\Debug\Exception\ClassNotFoundException:
Attempted to load class "ContainerParametersResourceChecker" from namespace "Symfony\Component\DependencyInjection\Config".
Did you forget a "use" statement for another namespace?
at var/cache/dev/ContainerWz8cB8L/srcDevDebugProjectContainer.php:357
at ContainerWz8cB8L\srcDevDebugProjectContainer->ContainerWz8cB8L\{closure}()
(vendor/symfony/config/ResourceCheckerConfigCache.php:95)
at Symfony\Component\Config\ResourceCheckerConfigCache->isFresh()
(vendor/symfony/config/ResourceCheckerConfigCacheFactory.php:42)
at Symfony\Component\Config\ResourceCheckerConfigCacheFactory->cache('/home/dari/domains/dari.us.lt/public_html/symfony_4_persons_demo/var/cache/dev/srcDevDebugProjectContainerUrlMatcher.php', object(Closure))
(vendor/symfony/routing/Router.php:302)
at Symfony\Component\Routing\Router->getMatcher()
(vendor/symfony/routing/Router.php:256)
at Symfony\Component\Routing\Router->matchRequest(object(Request))
(vendor/symfony/http-kernel/EventListener/RouterListener.php:109)
at Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(object(GetResponseEvent), 'kernel.request', object(EventDispatcher))
(vendor/symfony/event-dispatcher/EventDispatcher.php:212)
at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(array(object(DebugHandlersListener), 'configure'), array(object(ValidateRequestListener), 'onKernelRequest'), array(object(SessionListener), 'onKernelRequest'), array(object(RouterListener), 'onKernelRequest'), array(object(ResolveControllerNameSubscriber), 'onKernelRequest'), array(object(LocaleListener), 'onKernelRequest'), array(object(TranslatorListener), 'onKernelRequest'), array(object(TraceableFirewallListener), 'onKernelRequest')), 'kernel.request', object(GetResponseEvent))
(vendor/symfony/event-dispatcher/EventDispatcher.php:44)
at Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.request', object(GetResponseEvent))
(vendor/symfony/http-kernel/HttpKernel.php:127)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:66)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:190)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(public/index.php:34)
Update:
By the comment I am still not sure what to do. Here was link in the comment: How to deploy a symfony project without SSH and CLI access to production
set parameters.yml
Do not see such file.
Environtment vars - I think they are copied to the cache during the $parameter->resolve()
I do not think I can set them without command line.
cache:clean --env prod
Deleted cache folder contents manually in ftp.
delete the logs
Does it really matter?
assets:install --env prod
I do not think I use them.
I just set permissions to 777 on var folder in case something is wrong because of them. Its not a production server, so not caring too much about security, just need to run a demo.
You need a fully working build on your localhost with the production setup and then upload it. You know which is all the steps for your particular project to work locally. So clone your project in a new folder for the production setup and do all the steps. Once you are done, upload everything to the server and fix the permissions of the keys folders.
Note: parameters.yml is the file where you set your symfony parameters like:
but in symfony 4 it has been replaced by environtment vars.