2
votes

I'm trying to deploy a Symfony2 application in a shared hosting and everyone knows that nobody can run any command on that type of hosting so this is what I do in order to get things done and after reads the docs at Symfony.com site:

All this was done in my development server:

  • Run the command php composer.phar install --no-dev --optimize-autoloader
  • Run the command php app/console assetic:dump --env=prod --no-debug

Then after all was done I copied the entire folder to my shared hosting but now I'm getting this error:

Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/html/tanane/app/../var/logs/prod.log" could not be opened: failed to open stream: No such file or directory' in /home/tanane72/public_html/tanane/var/cache/prod/classes.php:5014 Stack trace: #0 /home/tanane72/public_html/tanane/var/cache/prod/classes.php(4958): Monolog\Handler\StreamHandler->write(Array) #1 /home/tanane72/public_html/tanane/var/cache/prod/classes.php(4883): Monolog\Handler\AbstractProcessingHandler->handle(Array) #2 /home/tanane72/public_html/tanane/var/cache/prod/classes.php(5083): Monolog\Handler\AbstractHandler->handleBatch(Array) #3 /home/tanane72/public_html/tanane/var/cache/prod/classes.php(5388): Monolog\Handler\FingersCrossedHandler->handle(Array) #4 /home/tanane72/public_html/tanane/var/cache/prod/classes.php(5488): Monolog\Logger->addRecord(500, 'Uncaught PHP Ex...', Array) #5 /home/tanane72/public_html/tanane/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ExceptionListene in /home/tanane72/public_html/tanane/var/cache/prod/classes.php on line 5014

The file prod.log exists in shared hosting but Symfony is looking in my development server as this line said /var/www/html/tanane/app/../var/logs/prod.log, where I can change that behavior? How the process works in order to change this route to the current one on shared hosting?

1
That's because you upload the cache directory?tttony

1 Answers

4
votes

You need to copy all files to shared hosting, except app/cache and app/logs dirs. And then in app/config/parameters.yml change database connection to new one. Then set permissions on app/cache and app/logs dirs to 777

That's all

P.S. And don't forget to check PHP version on hosting, better use 5.4 or 5.5.