If you throw some SSL onto your NGINX hosted website (as you’ve likely noticed thomashunter.name is now doing), you may notice a few hard-to-diagnose issues. Many PHP scripts look for the presence of a certain server variable, namely, $_SERVER[‘HTTPS’], to determine if it is behind an SSL connection. To fix this, you need to add the following… Read more »
Posts Tagged: PHP
I just put down my copy of Hands-on Testing with PHPUnit How-to by Michael Lively, published through Packt Publishing. Hands-on Testing with PHPUnit How-to on Amazon Hands-on Testing with PHPUnit How-to on Packt Overall, this is a pretty good book, and covers all of the topics one would expect from a Unit Testing book. Such… Read more »
Due to RAM restrictions on various servers I’ve had to use, I learned to axe Apache a long time ago. I’ve replaced it with lighttpd, although I’ll probably be transitioning over to nginx sooner or later (it’s what we use at work, and seems to be even lighter in the memory consumption department). Therefor, all… Read more »
These are my notes for the talk I’m giving today on PHP and MongoDB. Example PHP script for communicating with MongoDB: #!/usr/bin/env php <?php // Instantiate the Mongo client $m = new MongoClient(); // Connect to a database. If it doesn’t exist, it will be created $db = $m->example; // Point to a collection within… Read more »
I’ll be giving a Talk on MongoDB and PHP this Saturday at the Ann Arbor PHP MySQL Meetup. Come check it out if you’re in the area.
Back when I was teaching a PHP/MySQL meetup, I wanted to get my members to use a PHP MVC framework, one that had new PHP 5.3 features at the time (such as namespacing), as well as other good PHP 5 features (like autoloading). The framework had to be so easy to use that the codebase… Read more »
I recently tried using the PHP mail() function on my OS X Mountain Lion installation, but was greeted with some errors instead of a successful email. I’m not sure why the mail function stopped working after upgrading to Mountain Lion, but it appears to be some sort of permissions issue. To fix the issue, execute… Read more »
The Symfony2 Book has an excellent page about MVC versus Flat PHP. It’s made by the Symfony folks, but it is a framework-agnostic discussion, showing an evolution from one approach to the other.
I recently had the need to change all of my OGG files to MP3s. Sure, there is a quality loss issue, but I prefer being able to play my music in my car and MP3 player over perfect quality. This script will recursively find all OGG files, and convert them into an MP3 file with… Read more »
A lot of this article will apply to any network based application, but since I’m a web developer, I’m going to put a web spin on things. Also, I couldn’t help but get into compression a little while discussing browser caching. Caching is a vital part of any high traffic web app, especially ones which… Read more »