The Evolution of PHP – Infographic

PHP was created by Rasmus Lerdorf in 1994 and was publicly released in June 1995. Back then, it was the abbreviated form of Personal Home Page tools. After two years, in 1997, it entered public domain as PHP/F1 2.0. A year later, two programmers, Zeev Suraski and Andi Gutmans, rewrote the base of the original version and launched PHP 3.

PHP 4, which came out in 2000, incorporated a scripting engine named Zend Engine that was designed by Suraski and Gutmans. Three more major versions with some sub-versions were launched in the later years with the latest version 7.0 released in 2015.

Two decades after its inception, PHP has registered a phenomenal growth and is still going strong. Today, it controls over 80% of all the websites on the globe. This includes majors like Facebook, Wikipedia and WordPress among others.

The Evolution of PHP – Infographic

Your software is Vitamin or Painkiller?

How to Quickly Tell If Your Software Product Idea Will Be Successful :

The dream of many software developers is to create their own business, so they can work for themselves all the time instead of working for others.

So they start thinking of ideas for new software products, but they are never certain of which ideas will be successful. So they often pick one idea they like and then start working it. After many months they launch it but often the product does not have the traction they hoped.

This is what is called the shot in the dark. The dream turns into a frustration. I have found myself in this situation many times, so I thought to myself that there should be a way to avoid the frustration.

I found the best description for PHP 7 upgrade

I did the upgrade by this article but the PHP did’nt work:

This works for me: 1. Re-Install PHP 5.6

sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0

From php5.6 to php7.0 :

sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart


PHP7: Mcrypt PHP extension required.

sudo apt-get update
sudo apt-get install mcrypt php7.0-mcrypt
sudo apt-get upgrade


php7 CURL PHP extension:

sudo apt-get install php7.0-curl

install GD:

sudo apt-get install php7.0-gd
max_file_uploads 2 -> 20M

sudo nano /etc/php/7.0/apache2/php.ini

I edited in nano.

sudo service apache2 restart



sudo apt-get install php7.0-sqlite3
sudo service apache2 restart


php framework independent development

I am searching the solution. Some useful article.

Build your own PHP Framework with Symfony Components :

Symfony2: How to create framework independent controllers? :

Symfony2: Framework independent controllers part 2: Don’t use annotations :

Symfony2: Framework independent controllers part 3: Loose ends :

Definitive Laravel 4 to Laravel 5 Migration Guide :

Removes duplicates values from an multidimensional array (PHP)

The idea: Serialize the item of the item (array) of the multidimensional array

Than Sort out the same item.

// serialize — Generates a storable representation of a value
$workArr =array();
foreach ($newDateArr as $value) {
$workArr[]= serialize ( $value );

$workArr = array_unique($workArr);

//unserialize — Creates a PHP value from a stored representation
$workArr2 =array();
foreach ($workArr as $value) {
$workArr2[]= unserialize( $value );

other source – but this was not worked for me:

How to remove duplicate values from a multi-dimensional array in PHP

PHP sessions default timeout


Q: would a user eventually be “logged out” after some time of inactivity?
A: It depends on the server configuration or the relevant directives (session.gc_maxlifetime) in php.ini. Typically the default is 24 minutes (1440 seconds), but your webhost may have altered the default to something else.

CakePHP – session timeout:

Preventing Memory Leaks in PHP

Image resizing need memory. I use this script to prevent memory leak.

I use Intervention Image library for resizing I often get ‘Allowed memory size of …. bytes exhausted (tried to allocate … bytes)’ message.

//get memory_limit info from php.ini
$memoryAvailable = filter_var(ini_get(“memory_limit”), FILTER_SANITIZE_NUMBER_INT) * 1048576;

//getting the image width and height
$imageInfo = getimagesize($destinationPath . ‘/’ . $filename);

//This is quite rough and includes a fudge factor, 2.5, which you may want to experiment with.
$requiredMemory = ( $imageInfo[0] * $imageInfo[1] * ($imageInfo[‘bits’] / 8) * $imageInfo[‘channels’] * 2.5 );

//check memory usage
if (memory_get_usage() + $requiredMemory < $memoryAvailable) {

//we have enough memory to resize the image.

Free PHP obfuscator, Encoding PHP

PHP: Code obfuscation in 10 steps:


Encoding & Decoding PHP Code:


PHP Classes:

GitHub: PHP Obfuscator

Ncryptd, open-source:

PHP Obfuscator

This is an “obfuscator” for PSR/OOp PHP code. Different from other obfuscators, which often use a (reversible) eval() based obfuscation, this tool actually parses PHP, and obfuscates variable names, methods, etc. This means is can not be reversed by tools such as UnPHP. This library was written out of the need to obfuscate the source for a private library which for various reasons could not be shared without steps to protect the source from prying eyes. It is not technically feasible to “encrypt” PHP source code, while retaining the option to run it on a standard PHP runtime.

install: git clone , composer install

Run: path//php-obfuscator$ ./bin/obfuscate obfuscate input output

input, output – directories in the php-obfuscator folder.


PHP Design Patterns

This is a collection of known design patterns and some sample code how to implement them in PHP. Every pattern has a small list of examples (most of them from Zend Framework, Symfony2 or Doctrine2 as I’m most familiar with this software).

Egy nagyon hasznos, példákkal teletűzdelt összefoglaló a PHP-ban használatos (divatos) programozási mintákról .


Multiton (is considered an anti-pattern! )
Singleton  (is considered an anti-pattern! )