Monthly Archives: March 2017

virtualmin – multiple php versions, using fcgid – problem with php handler [SOLVED]

Want multiple php versions on the same virtualmin host?

Follow instructions here:
https://www.virtualmin.com/documentation/web/multiplephp
and

Installing PHP 5.6.x and 7.0.x with Ubuntu 14.04 and Virtualmin 5.0gpl using a PPA

Use fcgid as “Default PHP Execution Mode” …

And tada …. php files are being downloaded instead of being executed …

If this happens go to:

vi/nano/mmcedit /etc/apache2/mods-enabled/php7.0.conf
and comment the following 2 lines:

# SetHandler application/x-httpd-php
...
# SetHandler application/x-httpd-php-source

restart apache2, and it should work

find all MyISAM tables

SELECT TABLE_SCHEMA as DbName ,TABLE_NAME as TableName ,ENGINE as Engine FROM information_schema.TABLES WHERE ENGINE='MyISAM' AND TABLE_SCHEMA NOT IN('mysql','information_schema','performance_schema');

And maybe you want to convert them to InnoDB, this script generates you the queries:

SELECT CONCAT('ALTER TABLE ', TABLE_SCHEMA, '.', TABLE_NAME,' ENGINE=InnoDB;')
FROM Information_schema.TABLES WHERE TABLE_SCHEMA = 'yourDBName' AND ENGINE = 'MyISAM' AND TABLE_TYPE = 'BASE TABLE'