The HTTP Authentication header is missing

The HTTP Authorization request header contains the credentials to authenticate a user agent with a server, usually after the server has responded with a 401 Unauthorized status and the WWW-Authenticate header.

If you are using Apache2, you may notice that the HTTP_AUTHORIZATION is missing from the list of variables sent to you. This is because Apache2 decides to not send clear passwords (even if base64 encoded) across processes.

Continue reading “The HTTP Authentication header is missing”

How to install OpenLiteSpeed and PHP 7.3 / 7.2 / 7.1 / 7.0 from LiteSpeed repositories on Debian 9 (stretch) / 8 (jessie)

We are going to install OpenLiteSpeed on Debian 9 (stretch) / 8 (jessie) server from LiteSpeed repository. OpenLiteSpeed is the open source edition of LiteSpeed Web Server Enterprise. Both servers are actively developed and maintained by the same team, and are held to the same high-quality coding standard. OpenLiteSpeed contains all of the essential features found in LiteSpeed Enterprise, and represents our commitment to support the Open Source community. It is recommended to use CentOS 7 / 6 for OpenLiteSpeed for stability.

Continue reading “How to install OpenLiteSpeed and PHP 7.3 / 7.2 / 7.1 / 7.0 from LiteSpeed repositories on Debian 9 (stretch) / 8 (jessie)”

How to install OpenLiteSpeed and PHP 7.3 / 7.2 / 7.1 / 7.0 / 5.6 from LiteSpeed repositories on CentOS 7 / 6

We are going to install OpenLiteSpeed on CentOS 7 / 6 server from LiteSpeed repository. OpenLiteSpeed is the open source edition of LiteSpeed Web Server Enterprise. Both servers are actively developed and maintained by the same team, and are held to the same high-quality coding standard. OpenLiteSpeed contains all of the essential features found in LiteSpeed Enterprise, and represents our commitment to support the Open Source community. It is recommended to use CentOS 7 / 6 for OpenLiteSpeed for stability.

Continue reading “How to install OpenLiteSpeed and PHP 7.3 / 7.2 / 7.1 / 7.0 / 5.6 from LiteSpeed repositories on CentOS 7 / 6”

How to migrate from PHP 7.0 to PHP 7.2 – Ubuntu & Debian

How to migrate from PHP 7.0 to PHP 7.2 in five minutes.

1. Add PPA ondrej/php

We use Ondřej Surý’s awesome PHP PPA. It already has PHP 7.2, so we’ll add the PPA and update the package information.

Ubuntu

add-apt-repository ppa:ondrej/php
apt-get update

Debian

apt install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
apt-get update

2. Current PHP packages

This only applies if you are upgrading from a previous version. Note down the current PHP packages you have, so we can reinstall them for PHP 7.2.

dpkg -l | grep php | tee packages.txt

This will save your current packages to packages.txt file in your working directory.

3. Install PHP 7.2

apt-get install php7.2 php7.2-common php7.2-cli php7.2-fpm

This will install the bare basic packages you’d need to get started with PHP 7.2. Note that php7.2-fpm package is used for your web server integration. If you are using Apache with prefork MPM (type apachectl -V to see the MPM used), you’d need to install libapache2-mod-php7.2 instead of php7.2-fpm.

4. Install additional modules

Take a look at the packages.txt file we created at step 2, and install the additional PHP packages. Your packages.txt file will show packages such as php7.0-mbstring, and you need to install their PHP 7.2 counterpart (php7.2-mbstring for example).

You can generate a command that can be run later using this line.

apt-get install $(cat packages.txt | awk '{ apt-get install gsub("7.0", "7.2", $2); print $2 }' | tr '\n' ' ' | sed 's/php7.2-mcrypt //g')

5. Web server configuration

Apache with php-fpm

Before we remove the old PHP packages, make sure that your web server correctly uses the PHP 7.2 sockets/modules. If you installed php7.2-fpm above, and using Apache, a2enconf php7.2-fpm will make Apache use PHP 7.2 FPM. Type a2disconf php7.0-fpm to disable existing FPM configurations.

Apache with mod_php

You can disable the current PHP integration with a2dismod php7.0 (or your current version) and enable new PHP 7.2 module with a2enmod php7.2.

6. Remove old versions

If everything is working well (check your phpinfo() and php -i), you can remove the old packages:

apt-get purge php7.0*

Of course, change php7.0 with all old versions you no longer need.

Enjoy your shiny new PHP 7.2!