Friday, April 20, 2018

Drupal : PHP Fatal error: Interface 'Symfony\Component\HttpKernel\HttpKernelInterface' not found in core/lib/Drupal/Core/DrupalKernelInterface.php on line 15

While running drupal import database command or any similar drupal command using command line, if you get following error :

Fatal error: Interface 'Symfony\Component\HttpKernel\HttpKernelInterface' not found in core/lib/Drupal/Core/DrupalKernelInterface.php on line 15

You need to update composer with optimize autoloader, Here is the command.

Solution :

composer update --optimize-autoloader

composer - mpdf - php fatal error : class mPDF not found

Same vendor folder of one server is not working on another server. There may be reason that working server has php 5.5 and non working server has php 5.6

Add following lines in file vendor/composer/autoload_classmap.php

'UCDN' => $vendorDir . '/mpdf/mpdf/classes/ucdn.php',
'bmp' => $vendorDir . '/mpdf/mpdf/classes/bmp.php',
'cssmgr' => $vendorDir . '/mpdf/mpdf/classes/cssmgr.php',
'directw' => $vendorDir . '/mpdf/mpdf/classes/directw.php',
'grad' => $vendorDir . '/mpdf/mpdf/classes/grad.php',
'mPDF' => $vendorDir . '/mpdf/mpdf/mpdf.php',
'meter' => $vendorDir . '/mpdf/mpdf/classes/meter.php',
'mpdfform' => $vendorDir . '/mpdf/mpdf/classes/mpdfform.php',
'otl' => $vendorDir . '/mpdf/mpdf/classes/otl.php',
'tocontents' => $vendorDir . '/mpdf/mpdf/classes/tocontents.php',
'wmf' => $vendorDir . '/mpdf/mpdf/classes/wmf.php',
Add following lines in file vendor/composer/autoload_static.php
'UCDN' => __DIR__ . '/..' . '/mpdf/mpdf/classes/ucdn.php',
'bmp' => __DIR__ . '/..' . '/mpdf/mpdf/classes/bmp.php',
'cssmgr' => __DIR__ . '/..' . '/mpdf/mpdf/classes/cssmgr.php',
'directw' => __DIR__ . '/..' . '/mpdf/mpdf/classes/directw.php',
'grad' => __DIR__ . '/..' . '/mpdf/mpdf/classes/grad.php',
'mPDF' => __DIR__ . '/..' . '/mpdf/mpdf/mpdf.php',
'meter' => __DIR__ . '/..' . '/mpdf/mpdf/classes/meter.php',
'mpdfform' => __DIR__ . '/..' . '/mpdf/mpdf/classes/mpdfform.php',
'otl' => __DIR__ . '/..' . '/mpdf/mpdf/classes/otl.php',
'tocontents' => __DIR__ . '/..' . '/mpdf/mpdf/classes/tocontents.php',
 'wmf' => __DIR__ . '/..' . '/mpdf/mpdf/classes/wmf.php',
Now run the same web page again in browser. You should not get error.

Lets encrypt error while renewing

The client lacks sufficient authorization :: Invalid response from

Full error :


Attempting to renew cert (domain.co.in) from /etc/letsencrypt/renewal/domain.in.conf produced an unexpected error: Failed authorization procedure. domain.co.in (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://domain.co.in/.well-known/acme-challenge/jfJj7OuSofik58w5Zv9QGADQFTR4OK_nfgVNOfg1xTw: "<!DOCTYPE html>
<html lang="en-US" class="bg-black">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width". Skipping.


Solution :
Do not renew it, instead of install certificates again
sudo certbot --apache -d domain.co.in