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”

Nginx and PHP – configure php.ini file

We already have a configured a Nginx web server and PHP-FPM wrapper. It’s time to change PHP default settings now – default configuration files from Ubuntu or Debian repositories aren’t bad, but we can make them better for our needs. In this chapter we will change only one file, php.ini, which should be located on /etc/php/YOUR_VERSION/fpm/ directory. Of course, fell free to use other settings than proposed on this blog entry.

Continue reading “Nginx and PHP – configure php.ini file”

PHP – generate secure password

This post will be very short. We must sometimes generate random password in PHP – for example when users create accounts on our service, or we send them new password after reset. Yes, we can do this in many ways, but most of them are bad solutions – we can create function (or method, class) to generate random string from given range, do it manually and try to make all random. But it isn’t random – it must by real secure, we must  use cryptographically secure pseudorandom generator.

Continue reading “PHP – generate secure password”

Nginx – Add PHP-FPM

Recently I posted an entry related to the installation and basic configuration of the Nginx web server. In this episode, we’ll take care of adding PHP to it. Unlike Apache, we can not use the module for the server (mod_php) because Nginx does not have its native support. However, it is possible to redirect PHP-related requests to a separate PHP wrapper service. For this purpose, we will re-use Ubuntu distribution as well as an additional PPA repository. The entry does not describe the exact configuration of PHP, but only its installation and connection with Nginx – details of additional settings will be raised in the subsequent episodes of the cycle.

Continue reading “Nginx – Add PHP-FPM”

Sport is a kind of magic

This week, something amazing happened and I decided to share my impressions. I can hardly believe it, as if it did not really happen, but it happens. I go back in time to high school – running for one kilometer and I can not run half of this distance, I have enough and so much more I go than running. One day of this week Iwaited for good weather.. and waited… and waited.  and finally I went running in small a little drizzle. And I kept running, without stopping for two hours, I ran a half marathon, that is twenty times as much as I could not in the school.

Continue reading “Sport is a kind of magic”