T
T
the_end_oo2014-11-10 00:35:20
symfony
the_end_oo, 2014-11-10 00:35:20

How to deploy Symfony 2 project on shared hosting ?

Good evening.
I have a working project written in Symfony2. I would like to upload it to some free hosting, see how it will be.
But I'm new to this stuff and it doesn't work at all.
Constantly throws some errors.
In general, I uploaded the folders: app, bin, src, vendor, component to the root, and put everything that was in the web folder into public_html.
When I go to the site I get a lot of errors

Warning: is_dir(): open_basedir restriction in effect. File(/var/www/hw_5/Symfony/app/cache/prod/sessions) is not within the allowed path(s): (/home/u397346631:/tmp:/var/tmp:/opt/php-5.5/ pear) in /home/u397346631/app/cache/prod/classes.php on line 317
Warning: mkdir(): open_basedir restriction in effect. File(/var/www) is not within the allowed path(s): (/home/u397346631:/tmp:/var/tmp:/opt/php-5.5/pear) in /home/u397346631/app/cache/ prod/classes.php on line 318
Warning: ini_set(): open_basedir restriction in effect. File(/var/www/hw_5/Symfony/app/cache/prod/sessions) is not within the allowed path(s): (/home/u397346631:/tmp:/var/tmp:/opt/php-5.5/ pear) in /home/u397346631/app/cache/prod/classes.php on line 320
Warning: is_file(): open_basedir restriction in effect. File(/var/www/hw_5/Symfony/app/cache/prod/appProdUrlMatcher.php) is not within the allowed path(s): (/home/u397346631:/tmp:/var/tmp:/opt/php- 5.5/pear) in /home/u397346631/app/bootstrap.php.cache on line 2796
Warning: is_dir(): open_basedir restriction in effect. File(/var/www/hw_5/Symfony/app/cache/prod/annotations) is not within the allowed path(s): (/home/u397346631:/tmp:/var/tmp:/opt/php-5.5/ pear) in /home/u397346631/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php on line 67
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/hw_5/Symfony/app/logs/prod.log" could not be opened: failed to open stream: Operation not permitted' in /home /u397346631/app/cache/prod/classes.php:4939 Stack trace: #0 /home/u397346631/app/cache/prod/classes.php(4804): Monolog\Handler\AbstractProcessingHandler->handle(Array) #2 /home/u397346631/app/cache/prod/classes.php(5014): Monolog \Handler\AbstractHandler->handleBatch(Array) #3 /home/u397346631/app/cache/prod/classes.php(5256): Monolog\Handler\FingersCrossedHandler->handle(Array) #4 /home/u397346631/app/ cache/prod/classes.php(5363): Monolog\Logger->addRecord(500, 'Uncaught PHP Ex...',Array) #5 /home/u397346631/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php(104): Monolog\Logger->critical('Uncaught PHP Ex...', Array) #6 /home/u397346631/vendor/symfony/symfony/src/Symfony/Compon in /home/u397346631/app/cache/prod/classes.php on line 4939

And you know that it is not at all clear where it came from
/var/www/hw_5/Symfony
if there is no such thing on the server.
When I write app_dev.php in the address bar, I get the following error
ContextErrorException: Warning: is_file(): open_basedir restriction in effect. File(/var/www/hw_5/Symfony/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php) is not within the allowed path(s): (/home/u397346631:/tmp:/var /tmp:/opt/php-5.5/pear) in /home/u397346631/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php line 80

And also, where did it come from?
/var/www/hw_5/Symfony

Before uploading the cache was cleared.
Maybe it's my crooked hands. Once it doesn't rise.
If it's not difficult, write a step-by-step guide on how to upload a Symfony 2 project to shared hosting.
And how to configure the server if there is an ssh console with the following commands:
clear exit arch bzip2 cal cksum cmp cp crontab basename cd chmod ls date df du dos2unix unix2dos file getfacl gzip head hostid tail mkdir mv nslookup sdiff tar uptime wget whois.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Skobkin, 2015-09-03
@skobkin

If it's not difficult, write a step-by-step guide on how to upload a Symfony 2 project to shared hosting.

Briefly written here .
Ideally, you need to upload the application, upload the composer with it, log in via ssh and build the loader with the composer for the production environment.
Although, if you are into frameworks, then it is better to take a VPS at least so as not to limit yourself to the limitations that are on shared hosting. On some, there may even be settings that will interfere with the normal operation of the framework.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question