I have a website that I have been working of for a few years on and off and today it broke...

After trying to access the site - (http://justhardware.co.uk/) I get the following error thrown.

Fatal error: Call to a member function getOptions() on null in C:\Inetpub\vhosts\justhardware.co.uk\httpdocs\app\Mage.php on line 329

The code on line 329 is:

327  - public static function getBaseDir($type = 'base')
328  - {
329  -     return self::getConfig()->getOptions()->getDir($type);
330  - }

Please help!

  • revert the changes done before error...do you have the last modified files or did you install any extension?
    – Raghu
    Jul 24, 2017 at 10:47
  • Try to disable one by one custom modules, It seems that it is not getting configuration object so, ->getDir($type) is fired on null so it is throwing an error. Jul 24, 2017 at 10:50
  • @Magento2Learner I'm unable to get into front or backend to disable any custom modules.
    – 07lodgeT
    Jul 24, 2017 at 10:59
  • @EwallTester I only have a backup from a few months back because I'm a bad person
    – 07lodgeT
    Jul 24, 2017 at 11:01
  • magneto-root/app/etc/modules/ from here you can disable module by particular module .xml file Jul 24, 2017 at 11:02

2 Answers 2



It was a permissions issue, Plesk wouldn't change the permissions for all users on the online interface.

To fix all i had to do was RDP into the server and change the permissions using IIS.

Not sure of the why's or where's of this but hope I can help someone else


this file use


            * Copyright © Magento, Inc. All rights reserved.
            * See COPYING.txt for license details.

            /** @var $block \Magento\Catalog\Block\Product\View */

            <meta property="og:type" content="product" />
            <meta property="og:title"
            content="<?= /* @noEscape */ $block->stripTags($block->getProduct()->getName()) ?>" />
            <meta property="og:image"
            content="<?= $block->escapeUrl($block->getImage($block->getProduct(), 'product_base_image')->getImageUrl()) ?>" />
            <meta property="og:description"
            content="<?= /* @noEscape */ $block->stripTags($block->getProduct()->getShortDescription()) ?>" />
            <meta property="og:url" content="<?= $block->escapeUrl($block->getProduct()->getProductUrl()) ?>" />
            <?php if ($priceAmount = $block->getProduct()->getPriceInfo()->getPrice(\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE)->getAmount()) :?>
            <meta property="product:price:amount" content="<?= $block->escapeHtmlAttr($priceAmount) ?>"/>
            <?= $block->getChildHtml('meta.currency') ?>
            <?php endif;?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.