0

I am trying to install a Magento 2 store in a Ubuntu instance of AWS.

I am getting broken site like below

enter image description here

I used below commands

php bin/magento setup:upgrade

php bin/magento cache:flush

php bin/magento setup:static-content:deploy -f

php bin/magento deploy:mode:set developer

find . -type f -exec chmod 644 {} \;

find . -type d -exec chmod 755 {} \;

chown -R www-data:www-data /var/www/html/

I got below text in system.log file

[2018-11-07 12:04:30] main.CRITICAL: Can't create directory /var/www/html/generated/code/Magento/Framework/App/Http/.
Class Magento\Framework\App\Http\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only.$
[2018-11-07 12:08:58] main.CRITICAL: Can't create directory /var/www/html/generated/code/Magento/Framework/App/Http/.
Class Magento\Framework\App\Http\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only.$
[2018-11-07 12:19:04] main.CRITICAL: Can't create directory /var/www/html/generated/code/Magento/Framework/App/Http/.
Class Magento\Framework\App\Http\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only.$
[2018-11-07 12:39:42] main.CRITICAL: Can't create directory /var/www/html/generated/code/Magento/Framework/App/Http/.
Class Magento\Framework\App\Http\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only.$
[2018-11-07 12:41:53] main.INFO: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't ex$
[2018-11-07 12:41:53] main.INFO: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist$
[2018-11-07 12:41:53] main.INFO: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] $
[2018-11-07 12:41:53] main.INFO: Broken reference: the 'paypal.partner.right.logo' element cannot be added as child to 'sidebar.additional', because the latter doesn't $
[2018-11-07 12:41:53] main.INFO: Broken reference: the 'bml.right.logo' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2018-11-07 12:43:04] main.INFO: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't ex$
[2018-11-07 12:43:04] main.INFO: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist$
[2018-11-07 12:43:04] main.INFO: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] $
[2018-11-07 12:43:04] main.INFO: Broken reference: the 'paypal.partner.right.logo' element cannot be added as child to 'sidebar.additional', because the latter doesn't $
[2018-11-07 12:43:04] main.INFO: Broken reference: the 'bml.right.logo' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []

I got below output in exception.log file

[2018-11-07 12:04:30] main.CRITICAL: Can't create directory /var/www/html/generated/code/Magento/Framework/App/Http/.
Class Magento\Framework\App\Http\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only.$
Class Magento\\Framework\\App\\Http\\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-o$
[2018-11-07 12:08:58] main.CRITICAL: Can't create directory /var/www/html/generated/code/Magento/Framework/App/Http/.
Class Magento\Framework\App\Http\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only.$
Class Magento\\Framework\\App\\Http\\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-o$
[2018-11-07 12:19:04] main.CRITICAL: Can't create directory /var/www/html/generated/code/Magento/Framework/App/Http/.
Class Magento\Framework\App\Http\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only.$
Class Magento\\Framework\\App\\Http\\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-o$
[2018-11-07 12:39:42] main.CRITICAL: Can't create directory /var/www/html/generated/code/Magento/Framework/App/Http/.
Class Magento\Framework\App\Http\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only.$
Class Magento\\Framework\\App\\Http\\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-o$

What is the solution here ?

1

there is directory permission issue you may run this command in linux terminal and try

sudo chmod 777 /var/www/html/

  • 1
    Which version of magento your using? how you did installed the magento by composer or manual? – Muhammad Ayaz Nov 7 '18 at 13:18
  • 1
    are you using magento 2 latest version 2.2.6? – Muhammad Ayaz Nov 7 '18 at 13:21
  • 1
    @abuabu , glad you fixed it! – Muhammad Ayaz Nov 7 '18 at 13:21
  • 1
    Alright, what issue now your facing? – Muhammad Ayaz Nov 7 '18 at 13:38
  • 1
    Run these commands in your site root rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* var/session/* var/view_preprocessed/* pub/static/* php bin/magento setup:static-content:deploy -f sudo chmod 777 -R pub/static/ – Muhammad Ayaz Nov 7 '18 at 14:33

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.