PHP

PHP custom session handler changes in PHP7

If you are using a custom session handler probably you noticed this kind of issue when you upgraded to PHP7. Keep this information in mind since in the PHP documentation it is not really clear at the moment of writing this article. Since PHP 5 these changes affected custom session handler implementation: The read method […]

Install PHP 7 and xdebug for development environment

PHP 7 was released Compile PHP 7 from source for development environment git clone git@github.com:php/php-src.git && cd php-src ./buildconf ./configure \ –with-freetype=/usr/local \ –with-config-file-path=/opt/php7/config.d \ –with-config-file-scan-dir=/opt/php7/conf.d \ –prefix=/opt/php7 \ –with-zlib-dir \ –with-freetype-dir \ –enable-mbstring \ –with-libxml-dir=/usr \ –enable-soap \ –enable-calendar \ –with-curl \ –with-mcrypt \ –with-zlib \ –with-gd \ –disable-rpath \ –enable-inline-optimization \ –with-bz2 \ […]

Performance benchmark PHP 5 , PHP 5 + Opcache, PHP 5 + APC, HHVM

Is PHP good for any application? PHP is the most popular language on web-based applications with a huge amount of opensource components/reusable code and powered by a big community. I think it is important to understand it’s architecture first and then talk about scaling the application. And this may be a good reason to consider […]

Configure Zend Opcache extension for PHP

Zend Opcache extension installation If you want to speed up your PHP application maybe you are looking for a PHP accelerator such APC cache. Since PHP 5.5 there is another option for caching Opcodes (details): Zend OpCache extension If you are using PHP 5.5.0 and later Zend Opcache extension may be compiled with PHP, you […]

Install APC extension for PHP from sources

How to compile the PHP APC extension for your PHP version Used operating system: Ubuntu 14.04 There are few steps to follow until you will have your APC extension up and running for your particular PHP version: Download the latest version of APC wget http://pecl.php.net/get/APC Extract files and identify the default values for the following […]

Find in files – translations texts

Use case Follow this article if you want to locate multiple occurrences of a string in a folder using a regular expression pattern.  Find all occurrence of pattern Using the following code in the Linux command line you will copy all occurrence of the given pattern in a temporary file find ./ -name ‘*.*’ -exec grep […]

Use more than one PHP version in Nginx

In some cases probably you need to have different PHP versions on the same machine and using it on different domains. Install PHP You can install PHP versions by downloading already compiled packages or you can compile your own (with personalized configuration – quick PHP compile & install guide). Personally, I prefer for development machines […]

Install PHP 5.x from repository on Ubuntu

Install build tool Here are detailed steps for installing the compile tool for ubuntu. Install dependencies In most cases, quite a lot of dependencies will be missing. You can install most of them using the next command sudo apt-get install libxml2-dev libpcre3-dev libbz2-dev libcurl4-openssl-dev libdb4.8-dev libjpeg-dev libpng12-dev libxpm-dev libfreetype6-dev libmysqlclient-dev postgresql-server-dev-9.1 libt1-dev libgd2-xpm-dev libgmp-dev libsasl2-dev […]

X-debug installation and configuration

Find a few installation references Few steps for having  x-debug working on your local environment or development: Download the proper xdebug extension http://xdebug.org/download.php, or you can use xdebug wizard http://xdebug.org/wizard.php for more information about the environment. An alternative is to install using pecl: pecl install xdebug Copy binary file to PHP’s extensions folder Link this binary file […]