Php

My Homebrew CMS Was Co-Authored by Cthulhu

I publish this blog and seven other sites with Wordzilla, a CMS I wrote for myself and have never released. I began it 20 years ago and the PHP codebase is best examined in small doses because to look upon its full extent would bring a descent into madness worthy of Yog-Shoggoth. There's a spaghetti of half-implemented features, integrations with long-dead blogging services and random one-off solutions to ancient problems like the spammer from China whose IP block is still banned from ... (read more)

What Do I Think of the Pie?

With all the attention the RSS Advisory Board has been getting lately, I've been doing some work on the site, primarily to make it look better on mobile. I also wrote a tutorial on how to read RSS with PHP using SimplePie. For years my sites have used another library called Magpie to do the same thing, which made me wonder why people keep naming RSS libraries after pie. SimplePie co-creator Ryan Parman explained this on his blog: SimplePie is an amalgamation of the phrase "Simple API for Magpie ... (read more)

Fixing 'Call to Undefined Function' Filter_Var() in PHP

I host a lot of websites in the Amazon cloud on EC2. I recently discovered that all email one site was sending was being rated as spam and never seen by the recipient. This meant that new users didn't get the verification email required to complete signup. It appears that EC2 IP addresses can have a dodgy reputation among email providers. Another web publisher described these problems on AWS Developer Forums. Since then I've been rewriting my code to deliver emails with SendGrid, a service ... (read more)

Fix a 'Missing: Updated' Error in Google Search on WordPress

Google Search Console reported a bunch of structured data errors in a new WordPress blog I began recently. This was a surprise, because I didn't know I was offering structured data. The WordPress theme I've been using, Twenty Twelve, includes CSS styles in blog posts to support the hAtom microformat, which helps search engines recognize the components of a blog post such as the title, author and tags. When Google crawled the blog, the Structured Data section of Search Console flagged 20 pages ... (read more)

Fix a 'No HTTP Transports' Error in WordPress

I recently installed WordPress on this server for a new blog. I've been using homebrew software for years, but I want to see whether I like WordPress enough to switch this blog and others to the platform. I need all of my sites to be usable on mobile devices, a goal that is a long way from being true today. The new blog is far better out of the box on mobile than anything I've created on my own. In the two weeks I've been running WordPress 4.4.2, I encountered several problems where it could ... (read more)

Programming a Confidence Pool for the World Cup

I did some coding yesterday to run a 2014 World Cup confidence pool on SportsFilter. The way a confidence pool works is you assign points to teams based on how confident you are they will win. In this contest, you get point values from 32 down to 1 and assign them to the 32 World Cup teams. The more points you assign a team, the more you are awarded when that team wins or ties a match. Anyone can sign up for a SportsFilter account and play. A prize will be awarded to the winner: the Adidas ... (read more)

Creating a Closest Store Locator in PHP

Over the past year, one of my side projects has been the development of shopping directory sites for categories such as wargames, sports cards, videogames and farmers markets, the last of which I launched over the weekend. The sites are running on LAMP (Linux, Apache, MySQL and PHP) using my own code and the Smarty template language, which keeps me from cluttering up my web pages with PHP. As I prepared the newest site, I decided to implement a feature that takes a user-submitted address and ... (read more)

Sharing Blog Posts on Your Facebook Profile

Over the past few months, I've gotten back into contact with more than a dozen old friends and coworkers through Facebook. After blogging for nine years, I prefer hanging out here on Workbench over social networking sites, but I'm beginning to feel like an anachronism. It's easier for people to keep up with their BFFs on sites like Facebook than to visit a bunch of personal blogs, even with the help of RSS and a feed reader. I recently began linking my posts on Facebook using Simplaris ... (read more)

Creating PHP Web Sites with Smarty

I recently relaunched SportsFilter using the site's original web design on top of new programming, replacing a ColdFusion site with one written in PHP. The project turned out to be the most difficult web application I've ever worked on. For months, I kept writing PHP code only to throw it all out and start over as it became a ginormous pile of spaghetti. Back in July, SportsFilter began crashing frequently and neither I nor the hosting service were able to find the cause. I've never been an ... (read more)

Fixing a 'Recompile with -fPIC' Error in MySQL

I run my web servers by compiling the most important components from source code, which makes it possible for me to add security fixes more quickly and fine-tune my installations of Apache, MySQL and PHP. While compiling the new release PHP 5.2.8 this weekend, the make process failed with this error: /usr/bin/ld: /usr/mysql/lib/mysql/libz.a(compress.o): relocation R_X86_64_32 against 'a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/mysql/lib/mysql/libz.a: ... (read more)