Question

I`m facing following issue:

My stack is LEMP and Magento 2 is running without any problems, but-but-but...

While trying to switch into developer mode, using bin/magento file, the output informs me about successful switching, but still no exceptions are on the screen.

While I'm making typo in core files for a reason, I just see 500 error, and everything that I desire to make visible on the screen is just logged into the system.log file.

Please advice me.

Permissions are 777 for now, until I'll find the way to see the exceptions. I do not have declaration of the mode in .htaccess file and /etc/nginx/sites-enabled/magento.conf.

When I'm running bin/magento deploy:mode:show - it displays that I'm already in developer mode.

Here is output in system.log:

[2016-12-18 17:22:54] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_106f1b068ec7ccf4878f9284dd1137afd1 and handles catalog_product_prices: Please correct the XML data and try again. [] []
[2016-12-18 17:22:54] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_10c7461af04bb11fe209659d7147d2c579 and handles default, cms_index_index, cms_page_view, cms_index_index_id_home: Please correct the XML data and try again. [] []
[2016-12-18 17:22:54] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_100a98983867a1770682b48d9a0ad63441 and handles 1column: Please correct the XML data and try again. [] []
[2016-12-18 17:22:54] main.CRITICAL: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2016-12-18 17:22:54] main.CRITICAL: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2016-12-18 17:22:54] main.CRITICAL: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2016-12-18 17:22:54] main.CRITICAL: Broken reference: the 'paypal.partner.right.logo' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2016-12-18 17:22:54] main.CRITICAL: Broken reference: the 'bml.right.logo' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2016-12-18 17:22:54] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_106f1b068ec7ccf4878f9284dd1137afd1 and handles catalog_product_prices: Please correct the XML data and try again. [] []
[2016-12-18 17:23:07] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_10d41d8cd98f00b204e9800998ecf8427e and handles : Please correct the XML data and try again. [] []

But it is not the one I want. I want to reach seeing the following in the browser:

2016/12/18 19:21:22 [error] 9905#9905: *372 FastCGI sent in stderr:
"PHP message: PHP Parse error: syntax error, unexpected '}' in /var/www/magento2/app/autoload.php on line 23 PHP message: PHP Stack trace: PHP message: PHP 1. {main}()
/var/www/magento2/pub/index.php:0 PHP message: PHP 2. require()
/var/www/magento2/pub/index.php:13" while reading response header from upstream, client: 127.0.0.1, server: www.newmagento.com, request: "GET /admin/admin/cache/index/key/eafa4895505340712c8f26a49e451a246334ffe5e50cd75ddc79352ecabc36ef/
HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php5.6-fpm.sock:", host: "www.newmagento.com"

But I can find it only in error.log of my nginx.

Was it helpful?

Solution

I've tried to throw an exceptions before error handler was initialized. So, that`s the solution.

If you want to check if the developer mode is really working for you - throw an exception in /var/www/magento2/vendor/magento/framework/App/Bootstrap.php, after 255 line where error handler is initialized. For example paste this. Exception`s text was picked up randomly from allowed by M2.

$myVar = 1;
if ($myVar == 1) {
    throw new \Exception('We can\'t read some files that are required to run the Magento application. ' . 'This usually means file permissions are set incorrectly.');
            }
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top