In most cases your development machine will be local only, sitting behind a NAT or a firewall. So what happens when you need to show your progress externally or on a mobile device, or when you have to test a web hook from an external provider? This is possible, and a very simple task using ngrok. It’s completely open source, created by Alan Shreve (@inconshreveable) and it’s free! Some premium features you have to pay for, but for the most part you can use it in all its glory for no expense. It describes itself as:
Once your application reaches a critical mass of users, you want to be able to deploy without any abruptions in the service. Users could be really frustrated if they work on something and suddenly when they try to save they get a message saying the service is currently unavailable and their work is nowhere to be found. It’s a horrendous user experience. Striving for your deployment to be as fast and responsive as possible just won’t cut it. We need to make them atomic.
A while back I saw the announcement of a PHP conference that would take place here in Stockholm where I live. I was very excited since it’s the only conference I’ve heard of focused only on PHP here in Sweden. Actually it’s focused on Symfony, but the components are such a major part of PHP nowadays. And then I came around thinking that perhaps I could contribute something to this conference. I had previously only given presentations at meetups and really enjoyed doing that. And since I’m writing a book on deploying PHP applications, I thought it would be great to at least try to get a talk accepted for that topic. So I submitted my talk proposal with the title “Deploying PHP applications” to Symfony November Camp, and waited.
Using Git hooks to deploy your application is simple, this is a “git push to deploy” tutorial. Of course you need to use Git as your version control system, but hopefully you are already using it. You can achieve pretty much anything with your deploys with a simple setup. If you want to deploy your application with a simple
git push to your production server and automate all the necessary steps.
This is a question that frequently arises. Someone will ask me “Oh, you [work with/prefer/love] Laravel?” and my answer to that is a simple yes. What baffles me is the very frequent follow up question to that, which is “Well, what about Symfony?”. Every time I get this question, I’m stricken by it because I have never understood the question. It seems like there is a battle, Laravel vs Symfony.