0

When i login the backend of magento2 have a fatal error:

Fatal error: Only variables can be passed by reference in E:\www\magento2g\app\code\Magento\Backend\view\adminhtml\templates\system\search.phtml on line 31

The file search.phtml code is as follows:

 <script data-template="search-suggest" type="text/x-magento-template">
        <ul class="search-global-menu">
      <% if (data.items.length) { %>
           <% _.each(data.items, function(value){ %>
            <li class="item"
               <%- data.optionData(value) %>
               >
                <a href="<%- value.url %>" class="title"><%- value.name %></a>
               <span class="type"><%- value.type %></span>
               <%- value.description || "" %>
            </li>
            <% }); %>
       <% } else { %>
          <li>
                <span class="mage-suggest-no-records">
                   <?php /* @escapeNotVerified */ echo __('No records found.') ?>
               </span>
           </li>
       <% } %>
       </ul>
    </script>
Jeffery
  • 305
  • 1
  • 2
  • 7

1 Answers1

1

Magento 2 is incompatible with asp_tags on settings in php. Please disable it and try login one more time.

PS. asp tags support was removed in php7

KAndy
  • 20,811
  • 3
  • 49
  • 59