This morning, shortly after waking up, I got a text that a site was down and others were having problems all weekend.Continue reading post "#2384"
I’ve upgrade my site from Symfony version 3 to 4, without using Symfony Flex. I didn’t upgrade so much for new features, but mainly to be up to date, especially with Symfony 5 not far off.Continue reading post "Upgrade Symfony 3 to 4 without Flex"
I like Symfony’s console component, and use it for much of my command line scripting these days. One thing I dislike is that it takes use of some short option characters for itself. The built in handling of verbosity with
-v is nice and is fairly common in the CLI world, but some, like
-n, are more varied in use and would be desirable to have for various purposes in my own commands. I decided to remove these defaults in my own console app recently, and will describe how to do so.
I’ve finally updated my server to Ubuntu 18.04 using
Nice: in Symfony 4.1 we will finally be able to specify that an imported route shouldn’t have a trailing slash.Continue reading post "#1902"
I found myself wanting to check if a given URL path exists on another host of a multi-host Symfony application from within a controller action. The router service, which is the instance of Symfony’s routing component used to route requests to actions, has a
match() method, but it only accepts the path part of the URL. It also has a
matchRequest() method, but that seems to ignore the
SERVER_NAME of the passed
I was getting a white screen with 200 status in production after updating Symfony to 3.4.Continue reading post "#1696"
Continuing in the interest of providing multiple file formats for my web pages, I now have my home page available in XHTML5 format. URL’s just need
.xhtml tacked on the end, except for the home page, which needs
index.xhtml. This makes use of Symfony’s
_format URL parameter.
Struggling to figure out why every response from my Symfony application is showing up in the log files as a ‘200’ status. I thought it was related to this and this, since I’m running under FastCGI on Dreamhost, but attempting to set a
Status header didn’t help. Setting a regular response header in a plain PHP file does work, in fact. If I use ‘mod_rewrite’ to write another URL to load that same plain file, however, the status shows as ‘200’, so it must have something to do with ‘mod_rewrite’. Must get to bed though, so I will have to try another day.
I’ve been working on the HTTP headers my site sends recently. I had been working on performance / cache related headers, but after seeing mention of a security header scanner built by Scott Helme, I decided to spend a little time implementing security related headers on my site. I don’t really know these headers that well, so I added the headers it suggested and mostly went with the recommended values. I did read up a bit on what they mean though and modified the
Content-Security-Policy as I saw fit.
I added most of the headers using a Symfony reponse event listener. This handles all of my HTML responses without sending the headers for other responses, where they aren’t necessary. The exception is the
X-Content-Type-Options, which should be set for all responses. I set that in Apache configuration.