how to avoid running the webserver for symfony?
Closed this issue · 3 comments
Hi,
Since I do have apache2 installed and running, Is there any way to avoid running the webserver for symfony backend through the command below ?
$ php app/console server:run localhost:8080
Without running the webserver, I always get the error 500.
Thanks
The Symfony website has great documentation on how to get an application running in a production environment:
http://symfony.com/doc/current/cookbook/deployment/tools.html
For apache specific configuration:
http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html
Thank you @bayne for providing me documentations.
After googling a little, I found this command php app/console server:run localhost:8080 is used just to avoid the configuration of the webserver (which LAMP in my case) as described below:
How to Use PHP's built-in Web Server
Since PHP 5.4 the CLI SAPI comes with a built-in web server. It can be used to run your PHP applications locally during development, for testing or for application demonstrations. This way, you don't have to bother configuring a full-featured web server such as Apache or Nginx.
(see http://symfony.com/doc/current/cookbook/web_server/built_in.html)
Since all my symfony projects are working perfectly with actual configuration of my server LAMP, so I am wondering what only this project makes me getting:
The localhost page isn’t working
localhost is currently unable to handle this request.
500
So, my question is: "what 's the thing that made you adding in the documentation that running the webserver is requested?"
Anyway, if you have any ideas or proposals, I will be happy to take them!
Thanks,
FYI, the example is working perfectly if I run php app/console server:run localhost:8080
I found the problem in /var/log/apache2
. The folder src/Acme/DemoBundle/Resources/public/components/cache
is not writable.
Problem solved!
[Fri May 20 15:39:25.942449 2016] [:error] [pid 6600] [client ::1:59340] PHP Fatal error: Uncaught exception 'InvalidArgumentException' with message 'The directory "/home/amine/NetBeansProjects/symfony-angular-todomvc/src/Acme/DemoBundle/Resources/config/bower/../../public/components/cache" is not writable.' in /home/amine/NetBeansProjects/symfony-angular-todomvc/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92\nStack trace:\n#0 /home/amine/NetBeansProjects/symfony-angular-todomvc/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php(37): Doctrine\Common\Cache\FileCache->__construct('/home/amine/Net...', '.sp_bower.data', 2)\n#1 /home/amine/NetBeansProjects/symfony-angular-todomvc/app/cache/dev/appDevDebugProjectContainer.php(3661): Doctrine\Common\Cache\FilesystemCache->__construct('/home/amine/Net...', '.sp_bower.data')\n#2 /home/amine/NetBeansProjects/symfony-angular-todomvc/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(314): appDevDebugProjectContainer->getSpBower_BowerManagerService()\n#3 /home/amine/NetBeansProjects/symfony-angular-to in /home/amine/NetBeansProjects/symfony-angular-todomvc/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php on line 92