Ivo Petkov
Founder of Bear CMS and Alle.bg
Creator of Bear Framework
Co-founder of a great family

Recent posts

Reading locked files in PHP
Ivo Petkov
I hope that you are already familiar with the awesome file locking mechanism that PHP and your OS provide. If not, here is a  ...
Advanced PHP: 7 useful techniques that are rarely used
Ivo Petkov
In human languages, not all words are equally used, but they all have a purpose and unique power. The same is true for programming languages. A big part of the code we write is just variables, functions, classes, and loops. They are part of the basics you need to know to get your application done. Today I am not going to talk about them. Instead, I'll show you some of the PHP techniques I rarely use but have great impact.

Let's get started.
Install PHP and Apache from source
Ivo Petkov
Installing software in Linux using a package manager is easy as typing "yum install the-name-of-the-thing". But sometimes you want to make deep customizations or make multiple installations of the same software (different PHP or Apache httpd versions for example). Then the only thing you can do is install the software from its source, and this is not that easy. In the following lines you will learn how to install PHP (with PHP-FPM and OPcache) and Apache from source code.
A better HTML5 parser for PHP
Ivo Petkov
HTML and PHP have existed for a long time, and one of the main use cases for PHP is to render HTML. Unfortunately, it is not that easy to parse and modify HTML in PHP, especially HTML5. That's why I created a simple library that will help you do that, and more, easily. It extends PHP's native DOMDocument library, so it is very familiar to use. DOMDocument is a very powerful library, but it doesn't work quite well with HTML5. So, meet HTML5DOMDocument - an open source library that extends DOMDocument, fixes some issues and adds some functionality.
Let's Encrypt on EC2
Ivo Petkov
The year 2016 started with a couple of free SSL certificate solutions. CloudFlare offers a free certificate for all their customers; Amazon joined with AWS Certificate Manager, and Let's Encrypt is in public beta. Today I want to show you how easy it is to get a free certificate from Let's Encrypt and automatically renew it in the future. I'll provide the commands for an Amazon Linux AMI, but they are similar for other Linux distributions.

There are some things you should know about Let's Encrypt:
  1. Certificates last only 90 days.
  2. You are "forced" to automate the process. Actually, this is great, and I'll show you how to do it.
  3. They do not offer wildcard certificates.