Reputation: 57
wondering if someone can maybe help me out a bit.
I have been working on a project that is a symfony2 web app running on Microsoft azure. it was all working great! i have my code being pulled in from git and i can easily push and update the site.
I then started working on Logins, nothing fancy, i was playing around with HTTP_BASIC athuentication and had it working after following the docs here http://symfony.com/doc/current/book/security.html
I had a few users and i was pretty happy as id never done this before, my aim down the line is to use doctrine and databases etc but for the moment this will do.
so i had it working locally then i pushed to my branch. and boom 500 error. now i'm not sure what I've done and I've already done a bit of research, but nothing has really helped?
I read somewhere that by removing all the .htaccess files would be a fix, but no avail. the error that i'm getting is just a google 500 error and not a symfony error which makes me that I've really messed it up!
i could roll back to a previously working commit but id lose a lot of work on the front end side, but its confusing how everything is working absolutely fine locally but not on the server... please ask me any questions that could help you help me i guess!
help would be great. also, im a junior!
Upvotes: 0
Views: 343
Reputation: 13918
I built an clear symfony application, configured the security system with HTTP_BASIC authentication on local, and deployed to Azure Web app via GIT. I didn’t have 500 internal error.
So I suspect that there are some errors in the application.
Usually, when we deploy symfony applications to Azure via GIT, there several files and folders will not be updated with the application which may cause the application lack of dependent packages, we can check the list in .gitignore
file in root directory.
Login on KUDU console site of your Azure Web App, the URL should be: https://<your _site_name>.scm.azurewebsites.net/DebugConsole
, run the following commands in cmdlet:
cd site\wwwroot
(if you do not have composer.phar file in your project)
curl -sS https://getcomposer.org/installer | php
php composer.phar install
It will install the dependences and clear the cache.
Furthermore, we can check whether the application can run in dev mode, visit URL: http://<your _site_name>.azurewebsites.net/web/app_dev.php
, if it works fine in dev mode, but rise an error 500 in prod mode known as “app.php”, we should manually clear the production cache:
Login on KUDU console site, and run php app/console cache:clear --env=prod
.
If you get a [Symfony\Component\Filesystem\Exception\IOException]
exception, you can manually delete app\cache\prod
folder and run the command again.
Also, we can check the detail error messages in dev.log
and prod.log
in app\logs
folder.
Beside doing file operations in KUDU console site, we can use WebMatrix on Windows to remote our sites on Azure.
Upvotes: 1