Compile PHP 5.6 with pthreads and ZTS Ubuntu/Debian

Compile PHP with pthreads and ZTS on Ubuntu or Debian …and all most common extensions including multi-threading, PDO and mongo extension. 1. Setup your installation path first In the first step, we download the latest PHP sourcecode and download the sourcecode of pthreads and the mongo extension. I know it can be a struggle to…

Debian apt-pinning (Dotdeb, MariaDB, MongoDB, …)

Short post, I’d like to share my source lists for Debian 7.6, including apt-pinning for MariaDB / MySQL. It also includes all Packages from Dotdeb (Zabix, Redis, PHP, …).

Apt-pinning preference file for MariaDB / MySQL: /etc/apt/preferences.d/mariadb

Shared favs: Top tools and resources for the developer

First round,¬†shared favs! Here I am presenting you a collection of tools and helpful links that every developer should have heard of at least once.   LMVTFY: Let Me Validate That For You LMVTFY is a service that watches for new issues and new issue comments on a given GitHub repository. If the comments contain…

PHP elephant

Why you can’t put array variables right into a string

Code like this can be seen on SO a lot of times:

What’s wrong with it? It’s first of all, it’s the very opposite of clean and proper code style. Properly:

…is the way to go. Is it only style or is there a serious problem with it? Yep, the serious…

PHP elephant

configuration container vs globally define()ed contstants

Original thread by Pattle I’m working on a project where all the global constants have been defined in a class called Constants, for example:

Then throughout the code something like Constants::getMaxValue() is used to get the value of a constant. This seems a very strange approach why wouldn’t you just use the define function…

PHP elephant

eKomi PHP library

As I’ve been working with eKomi recently and wanted to share the PHP classes I developed to interact with their webservice. Currently supported register products add product specific marketing research options register orders fetch product reviews Coming next: fetch shop reviews   PHP library to interact with eKomi's API forks.4 stars.0 open issues.Recent commits: Project…

PHP elephant

Mastering UTF-8 encoding in PHP

Encoding issues can appear in several locations between backend / database and frontend. I’m going to explain each of those locations and how to properly implement a clean encoding throughout your project. What is a multibyte character? A single byte as in its primitive form is a number between 0 and 255, making up a…

PHP elephant

proper inline variable concatenation in PHP

This shortpost will be about good practice concetanation of variables in PHP and using PHP in HTML inline. My coding style is based on Zend. Concatening variables What you often see is are lines like this:

PHP is able to handle such, but it’s not the proper way of doing it. Not only for…

PHP elephant hacked?

Today I was not able to access from within Firefox without a big red warning. Did get hacked? I’m currently talking to other people on IRC and news sites to get information about this hack. We are not sure weather this is a false positive at the moment. Update 1: Rasmus Lerdorf: Except…