skip to Main Content

Yesterday i updated a module and with the composer update command also some magento framework files were updated. After that saving a product after adjusting stock is not possible anymore, PhP error shows up:

Warning: Narrowing occurred during type inference. Please file a bug report on bugs.php.net in /home/jilco01/public_html/vendor/composer/ClassLoader.php on line 444 and product is not saved

My magento 2.2.1 runs on Php 7.1.12 and with Opcache and Redis.

3

Answers


  1. Chosen as BEST ANSWER

    After switching on PHP-FPM the problem was gone...


  2. This is not a solution to the bug of PHP 7.1.12, but can help you to avoid this warning while coming out a patch or a new version (I suppose it could be solved then).

    The problem is with the OPCache library, that “… improves PHP performance by storing precompiled script bytecode in shared memory…” more info: http://php.net/manual/en/intro.opcache.php.

    The “solution” is clear the cache when the application is loaded. This is easy if you have an “single entry point” application (when you use a framework, for example). Just put the next function at the beginin of your index.php (or equivalent) file:

    opcache_reset();
    

    I’m not sure that this could be used in production servers, because could turn the application heavy.

    Login or Signup to reply.
  3. In my case error caused by restarted php-fpm after upgrade new release (for folder symlink update).

    Restart nginx additionally solve that error. But I think it’s temporary solution the php update should fix that.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search