Recently I noticed a few of my servers had stopped serving my sites, withย 502 errors being to visitors. I took a look at my site logs and noticed that they were full of the “Permission Denied” errors below: 2014/06/09 09:45:17 [crit] 11453#0: *22 connect() to unix:/var/run/php5-fpm.sock failed (13: Permission…
Read MorePNG Crush: PNG image optimisation script
Building a Cordova based mobile application recently at work we were facing an issue with an application size that was literally growing by the day. The project leveraged a lot of PNG templates sent to us by the design department and these template files were contributing about 50mb to the…
Read MoreTracing Email Sending PHP Scripts On Servers
It happens sometimes, a server you are responsible for seems to be sending out spammy emails, and its normally caused by legacy or insecure code. The mail log indicates there are plenty of potential spam messages going out that are originating locally but most Linux servers host a lot of…
Read MoreExecuting PHP Code Server Side In .html Files
On a recent project we needed to provide a client our contribution to the site code base as static .html files. To make the development process easier though a number of the developers wanted to include some of the global page assets such as the header and footer using PHP…
Read MoreUsing The Panoramio Wrapper Class
Ever been working on a project that was area specific and wanted nearby local images? I did recently, and knew after seeing images over layed onto Google maps that it must be possible. Looking around I found a few pieces of code that did what I wanted using the Panoramio…
Read MoreLogging PHP Errors For Production Environments
Good security practices dictate PHP should be configured to never display error messages and notices to screen in a production environment due to its potential to reveal information about your server and application setup. One solution is to enable error logging on the server by setting the log_errors attribute to…
Read MoreRemoving The WordPress Toolbar
One thing that has caused me some grief since the release of WordPress 3.1 is the admin bar that appears up the top of the blog when you are logged in. Call me a stick in the mud but I have never really used it since its introduction and on…
Read More