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”

Nginx – create our first virtual host

I recently posted an entry related to the installation and basic configuration of Nginx web server. In this chapter we will add the configuration of our website to server. This time we will no longer have to install any additional packages in the system or use additional external repositories. Everything is limited to editing existing files and optionally creating new ones – just as in Apache, which includes the configuration of each website. Of course, I’m assuming that you have already installed the Nginx server in accordance with the instructions from the previous chapter. This entry does not concern PHP configuration – this aspect will be discussed in the next chapter.

Continue reading “Nginx – create our first virtual host”

Nginx – installation and first configuration

I have already created a series of entries related to the configuration of the Nginx server, PHP-FPM and MariaDB database few years ago but all of them were in the Polish and also are currently outdated. I decided to create this series again, this time in English and with all fresh information about this modules and nice “tricks”. This post is first one with Nginx installation and global, standard configuration of this web server. I based on Ubuntu Server (16.04) and repositories for this distrubution. Installation may look different on other systems, but configuration is the same, independent of platform.

Continue reading “Nginx – installation and first configuration”

PHP-FPM – ondemand spawner mode

In the old, polish version of this blog, there are several posts about nginx server and PHP configuration. These entries are outdated now, but I will be writing them again in english soon. Meanwhile, today I would like to briefly share information on the ondemand mode in PHP-FPM. I have to used it and think it’s the best solution for most configurations.

Continue reading “PHP-FPM – ondemand spawner mode”

Fix: perl: warning: Setting locale failed

If you use OS X you can disover strange issue while connecting other machines through SSH (ex. Ubuntu Servers). It’s information about problems with load locales: perl: warning: Setting locale failed. It isn’t your server fault, but OS X default settings used in user session and profile. You can easily fix that issue editing profile file or for example ZSH config file.

Just edit ~/.profile and add that lines on the end:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

After that close terminal and open it again (ZSH) or just re-login to system. You can of course use other locales, specific to your system language and region settings.