Category Archives: php

Install Gearman Module to Ubuntu Xenial with PHP 7

The Gearman PHP module is the last piece of dependency missing in our stack before we can consider moving to PHP7. I’m currently testing Ubuntu 16.04 Xenial on PHP7 and unfortunately, the gearman module is not yet available on official … Continue reading

Posted in Linux, php | Tagged , | 2 Comments

Whipping some anonymous function in PHP

My goal is to validate a $_FILES array where uploaded file is an array of files. Due to the weird format of the $_FILES array for array version of the upload file, I have to validate each fields so that … Continue reading

Posted in php, Web Development | Tagged , , , | Leave a comment

A sample application running on Docker container – part 1

I’ve been using Docker for several months on my development and production environments. With Docker, I’m able to run multiple PHP applications, Django apps and RabbitMQ messaging containers simulteanously without having to deal with software package conflicts. I’d like to … Continue reading

Posted in Linux, php | Tagged , | 1 Comment

PHP – Instantiate a class from a string with namespace

I know this is old but I just learned it today. Instantiating a class from a string requires a full namespace of the class, otherwise it won’t work. You cannot use a namespace to make shortcuts. See example below. Shortcut? … Continue reading

Posted in php, Programming | Tagged , | 3 Comments

Cross domain AJAX that is cross browser as well

This is just a quick and dirty post about cross domain AJAX. If you wanted to create a working cross domain AJAX but also needs to secure the ajax requests from other referring domains, this is what we can do. … Continue reading

Posted in php | Tagged , , , | Leave a comment

Yum or rpm stuck with stale NFS mount

I was trying to upgrade one of the server’s PHP from PHP 5.2.x to PHP 5.3.x but no matter what I do, both yum and rpm gets stuck in the middle. I’ve spent two days trying to figure it out … Continue reading

Posted in Linux, php | Tagged , , , , , , | Leave a comment

PHP – APC really improves response time

Checking Google Webmaster Tool Yesterday, I noticed a noticeable increase of my blogs response time – meaning slower loading of my pages. I have originally no plan of using my VPS as a production box so I don’t bother installing … Continue reading

Posted in php | Tagged , , | Leave a comment

PHP – Setting and Getting Timestamp from DateTime Object below PHP 5.3.x

So we solved the timezone problem using PHP’s timezone aware DateTime class right? And you love working on UNIX timestamp/UTC but as to your surprise, you cannot set or get timestamp to a DateTime object on version below PHP 5.3.x. … Continue reading

Posted in php | Tagged , , , | Leave a comment

Trunk Spy – Monitors your SVN trunk for changes

At work, my lead asks the folks that manages the SVN repos to have a feature that notifies us every time somebody commits on trunk. They were not able to produce that feature nor find a plugin that does, therefore, … Continue reading

Posted in php, SVN | Tagged , , , , | 1 Comment

ob_start() – output handler ob_gzhandler conflicts with zlib output compression

In my PHP 5.4.x setup, an old project which uses ob_start() and ob_whatever() started to throw errors like Warning: ob_start(): output handler ‘ob_gzhandler’ conflicts with ‘zlib output compression’. On my development environment, I suppress this error by disabling zlib compression … Continue reading

Posted in php | Tagged , , , , , | 2 Comments