Specifying a User Agent when using file_get_contents() in PHP

By Josh Sherman
1 min read
development
php

I recently encountered a scenario where one of my site’s login system stopped working. The piece of code that stopped working was the third-party login that leveraged GitHub for the authentication. It was one of those “it worked yesterday” moments for sure. After some research, I discovered that GitHub had […]

LESS Icons for easy styling and customization

By Josh Sherman
2 min read
graphic design
css
less

Got a new project I wanted to share with everyone, it’s called icons.less (or LESS Icons) and it’s available for immediate forking and use over at GitHub. The project itself stemmed from my own desire to have a set of social icons that were easy to customize for different websites […]

How to Setup a LEMP Stack on Ubuntu 12.04 LTS

By Josh Sherman
3 min read
development
linux
nginx
mysql
php
ubuntu

Don’t get me wrong, there’s nothing wrong with a good ol’ LAMP stack (Linux, Apache, MySQL and PHP) but in my experience, Apache doesn’t necessarily scale all that well with PHP. It’s really not Apache’s fault, the fact is that most of the time servers are configured to use the […]

Command-Line PHP

By Josh Sherman
4 min read
development
php
command-line

PHP is a powerful scripting language but did you know it can be used from the command-line as well? Using PHP from the CLI has many applications from checking what version of PHP is installed to being able to execute scripts and even check the syntax of a file. If […]

Browser redirect with PHP

By Josh Sherman
1 min read
development
php

Within nearly every web site or application there is a need to redirect a user to another page. Perhaps you want to route them to a login page when they aren’t authenticated or maybe because a page moved and you want to take them to the new location. To accomplish […]