PHPExcel not working with PHP 7.+ – ZipArchive not found

PHPExcel ZipArchive not found

If you catch this error (and you use PHP 7 version) you need:
1. update PHPExcel to 1.8.+
or
2. try to use this preparing method:

PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);

P.s. https://github.com/PHPOffice/PHPExcel/issues/716

How to add one/two/n days or hours to date in MySQL (DATE_ADD in MYSQL)

Suppose you have a table in the database where the stored data and you need to check or get that dates but with the changes – calculate directly by MySQL.
Example, you want to get users end dates (7-day licence after registration):

SELECT `register_date`, `uid`, 
DATE_ADD(`register_date`, INTERVAL 7 DAY) AS `end_date` 
FROM `...`
WHERE...

Perfect, now you can show for user that his licence if over `end_date`…
In addition, you can subtract the required number of days
Continue reading How to add one/two/n days or hours to date in MySQL (DATE_ADD in MYSQL)

How to run Python Scripts ( *.py files) on Apache2 (configuring unix apache2 servers)

Preparing (install apache2, python):
Installation Apache2:

sudo apt-get install apache2

Installation Python(choose one):

sudo apt-get install python
sudo apt-get install python2.7
sudo apt-get install python3

First step: enabling CGI processing in your apache (automatically enable mod_cgid).

sudo a2enmod cgi

Second step: Allow run CGI scripts in your directory.
You can try allow by .htaccess in your “python” web folder

Options +ExecCGI
AddHandler cgi-script .py

or you can allow .py files to be executed as scripts in a particular folder you would use config in apache conf file:

    <Directory /srv/www/mysite/public_html/python_folder>
        Options +ExecCGI
        AddHandler cgi-script .py
    </Directory>

Finish step:
Continue reading How to run Python Scripts ( *.py files) on Apache2 (configuring unix apache2 servers)