Create development environment on MacOS using Homebrew

I prefer MacOS to develop, because it’s much more stable than Windows 10 – last issues with October update are the best evidence, that something is not ok with this OS development. It’s similar to Linux in many ways, but not exactly Linux like Debian, Ubuntu, RHEL etc. In effect, we can’t just use build-in repositories to install some required software, services and servers. But there is very nice option called Homebrew. Using this, we can make MacOS even closer to Linux system and configuration will be simpler.

Continue reading “Create development environment on MacOS using Homebrew”

PHP: anonymous functions, lambdas and closures

Three months ago I wrote post about arrow functions in JavaScript. It’s very nice feature, that can help write code faster and also solves “this” keyword range and visibility. This method is available in JavaScript and several other languages. But what about PHP? Unfortunatelly, we can’t use arrow functions in this language, they aren’t supported now (November 2018), there is only a RFC and experimental implementantion. Maybe in next versions… But we can also use anonymous functions, we can also use closures and lambdas. This post is about them.

Continue reading “PHP: anonymous functions, lambdas and closures”

Quick tip: increase PhpStorm memory limit

I use PhpStorm as my standard IDE in work. Why? I think it isn’t necessary to describe all advantages – it’s very good software, appreciated and recommended by many, many developers from whole world. PhpStorm can increase our productivity, we can work very fast with code inspection, integrated version control, debugging, testing and many, many other things. But PhpStorm is not perfect. It can be slow if we work with bad or low quality code – mix of not only PHP but also HTML, CSS and JavaScript in one file. With active default inspections and a lot of lines, it can be slooow and require more memory.

Continue reading “Quick tip: increase PhpStorm memory limit”

PHP-FPM – config improvements

We’ve already installed Nginx web server, PHP, run wrappers and configure php.ini settings. Next step will be some small improvements on global PHP-FPM configuration and also, additional settings on websites wrappers. Today we will edit /etc/php-fpm/version/fpm/php-fpm.conf file. It’s PHP-FPM main configuration file. Not PHP like php.ini from last chapter, but for FastCGI Process Manager. There is no time for unnecessary descriptions, let’s edit this file.

Continue reading “PHP-FPM – config improvements”