According to there documentation i needed to use phpinfo() to check for inconsistencies in my php.ini.

I have put it in the index.php because all other files are not accessable from the web. Or give error's like:

Fatal error: Uncaught Zend_Cache_Exception: cache_dir "/var/www/magento/var/page_cache" is not writable in /var/www/magento/vendor/magento/zendframework1/library/Zend/Cache.php:209 

Is there a command like: magento cache:opcache:reset ?


To clear PHP OPCache you can just restart PHP - systemctl restartphp7.0-fpm (For Ubuntu 16.04)

You can also create an opcache_clear.php file with the contents:


As a side note, to get your phpinfo() to work correctly you need to create the file within the /path/to/magento/pub/ directory to be able to access it via browser, for example:




  • I tried that but didn't worked for me. – Roger Getnoticed Nov 28 '17 at 11:10
  • From the error you've got it seems to be more a permission issue. Can you ensure that the var/page_cache directory is writable by the web server user/group? chown -R user:www-data /var/www/magento/var (Example) chmod -R 775 user:www-data /var/www/magento/var (Example) – Matt Antley Nov 28 '17 at 11:39
  • I have no idea, i'm a programmer not a system administrator. root@cli:/# chown -R user:www-data /var/www/magento/var chown: invalid user: 'user:www-data' – Roger Getnoticed Nov 28 '17 at 13:14
  • No worries - You can find the user/group of the rest of your files are using by running ls -la /var/www/magento/ This will output a list of all the files on the CLI that are in that directory we with some extra information. Pay close attention to the values -rw-r--r-- 1 user www-data (Should be at the far left of the output). If you're able to get a screengrab of the output and update your question with it I can advise further. Otherwise if you can copy/paste a similar output that I've put above I should be able to work it out. – Matt Antley Nov 28 '17 at 14:09
  • 1
    Yes, thanx @Matt Antley. It was a issue with rights in my docker environment. Have marked the answer as a working sollution. – Roger Getnoticed Dec 14 '17 at 10:57

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.