When Heroku announced their (quite reasonable) new limits for free apps, I realized that I would have to find another source of hosting for all the small, low-traffic projects that I currently have running on Heroku. Way back in the day, Heroku was totally free for apps that only required one dyno, but after years of abuse from jerks like me, they dropped that to eventually allowing free apps to run for 18 out of 24 hours per day (which is ok for low-traffic prototypes) and as of June 1, granting a shared pool of free hours.
Since I have such an unreasonable number of apps running on Heroku, I thought it was high time to try out Dokku. Dokku is a Heroku-like tool that allows you to deploy complex apps by simply pushing with Git. It supports Heroku buildpacks directly, so you can transition existing apps without difficulty, and has a number of plugins for datastores and other components. And, thankfully, Digital Ocean provides a pre-installed Dokku image that will spare you the trouble of installing Dokku yourself; you can just spin up a server and start Dokku-ing right away! This article will walk you through setting up a Dokku server on DigitalOcean with your own root domain and deploying a simple static site to it.
Differences between Dokku and Heroku
- Dokku requires at least some comfort level with running your own servers; you may have to modify nginx configurations, manually configure some plugins, or turn to the system tools for debugging.
- Dokku utilizes Docker, which is a fine platform but can add an extra layer of complexity to a server install.
- Dokku requires root access to a VPS to install plugins, run commands, etc.
In short, you're going to need to do a bit more command line setup on Dokku than Heroku --- nothing you can't pick up along the way, but you might need to do some light reading.
Creating a Dokku Server on DigitalOcean
First, log in to DigitalOcean and follow this link to create a new server on DigitalOcean using the preinstalled Dokku app. Dokku requires at least 1GB of RAM, but $10/mo to host all your stuff is a pretty small price.
For your hostname, enter the base domain you want to use to host your apps. Default Dokku apps will appear at
myapp.example.com). Make sure you own this domain and register it if you need to!
Continue reading %Heroku Alternative: Deploy Apps with Dokku on DigitalOcean%
Time to promote some open source projects again!
paragonie/hpkp-builder [15 ★]
This library aims to make it easy to build HTTP Public-Key-Pinning headers in your PHP projects, and requires at least PHP 7.
HTTP Public Key Pinning, or HPKP, is a security policy delivered via a HTTP response header much like HSTS and CSP. It allows a host to provide information to a user agent about which cryptographic identities it should accept from the host in the future. This can protect a host website from a security compromise at a Certificate Authority where rogue certificates may be issued for your hostname.
Read more about HPKP here.
Rican7/incoming [137 ★]
Incoming is a PHP library designed to simplify and abstract the transformation of loose, complex input data into consistent, strongly-typed data structures.
// Create our incoming processor $incoming = new Incoming\Processor(); // Process our raw form/request input into a User model $user = $incoming->process( $_POST, // Our HTTP form-data array new User(), // Our model to hydrate new UserHydrator() // The hydrator above );
Explaining it to any great detail is outside the scope of this short post, but in essence it allows us to precisely define what kind of input information goes through and hydrates our model, rejecting, filtering, or transforming everything else.
It's like Fractal, backwards. (Fractal makes sure the output matches a set structure, rather than input)
The library currently has one outstanding issue - and it's a discussion around a feature - but could definitely use some users and feedback! Maybe even a SitePoint post about it?
Continue reading %Sourcehunt: PHP7-Only Alternative to Laravel, HPKP, and More%
- By Cyril OganaIDEs are good to help debugging your code before it goes to production, but sometimes you need to find bugs in your code that cause problems and can only be observed in production. This is one case on which remote debugging is necessary.
IDEs like PHPEd support remote debugging. You do not need to download the project files from the production server to debug your project remotely. Thanks to the remote projects feature of PHPEd, it can retrieve only the server files that you need to debug so you can start debugging remote projects very quickly.
Read this article to learn how to setup and use PHPEd to debug remote projects running in production server for instance.
In this short tutorial, we’ll set up Sulu and optimize on a Vagrant environment. Why a dedicated tutorial handling this? Besides the fact that Sulu has a rather complex initialization procedure, it is based on Symfony which is infamously slow on virtual machines with shared filesystems, and thus needs additional optimizations post-install. The performance hacks in this post, while Sulu-specific, can be applied to any Symfony application to make it faster on Vagrant.
Would you like to learn more about Symfony and/or SuluCMS? Come join us at WebSummerCamp - the only conference filled to the brim with long, hands-on workshops. The program is out and it’s awesome! Super early bird tickets available until the end of June!
As usual, we’ll be using our Homestead Improved box as the base, but the steps below are explained in enough detail for you to follow them on any environment.
New Box and Folder Sharing
We start by downloading a fresh box and setting up folder sharing.
git clone https://github.com/swader/homestead_improved hi_sulu cd hi_sulu; bin/folderfix.sh
Continue reading %Can Symfony Apps Be Fast on Vagrant? Let’s Check with SuluCMS!%
- By Manuel LemosMany developers try to create their own business based on software that they develop but some fail, often due to the same mistakes that others already committed.
If those developers knew in advance what are those mistakes, they could have avoided failing, simply by not repeating the same mistakes.
Watch this short video to learn what are the top mistakes that you should avoid when you try to create your own software product business.