Install php7 on Debian 8

Install php7 on Debian 8

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y php7.3

Check php version

php -v

Installing PHP 7.3 Extensions

sudo apt install php7.3-cli php7.3-fpm php7.3-json php7.3-pdo php7.3-mysql php7.3-zip php7.3-gd  php7.3-mbstring php7.3-curl php7.3-xml php7.3-bcmath php7.3-json

To install Apache Module for PHP, run:

sudo apt install libapache2-mod-php7.3

PHP Warning: date(): It is not safe to rely on the system timezone settings

PHP Warning: date(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier

You probably need to put the timezone in a configuration line in your php.ini file. You should have a block like this in your php.ini file:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York
then restart httpd
#service httpd restart

PHP date.timezone list visit http://php.net/manual/en/timezones.php

Block other domain pointing our website ip address with .htaccess

How to block other domain pointing our website ip address with .htaccess

Simply add this code below to .htaccess

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.mydomain.com$
RewriteRule ^/?(.*) http://www.mydomain.com/$1 [QSA,R=301,L]

This rule will redirects to mydomain.com if another domain is pointing to our website or ip address

 

CaptchaSecurityImages.php Error function imagettfbbox Debian 7

CaptchaSecurityImages.php Error function imagettfbbox Debian 7

Php gd has been installed

Error Image security code not show

Solutions:

Open and edit CaptchaSecurityImages.php

Changed: "var $font = 'monofont.ttf';" to "var $font = './monofont.ttf';"

Save and restart apache2

Note: On CentOS server working good without any modification on code