Laravel PHP5.6 Class not found until opcache was enabled

Hi I have a Debian Wheezy VM that I recently upgraded to PHP 5.6 that ships with OpCache from 5.4 with OpCache installed separately. Since I did this, all my scripts (Im using Laravel btw) started to get cached which I didn't need, so I decided to disable opcache.

/etc/php5/mods-available/opcache.ini:

opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=2
opcache.fast_shutdown=1
opcache.enable_cli=0
opcache.enable=0

      

However, if I disable the apache php.ini file, I get the following error:

ReflectionException thrown with message "Class SettingRepository does not exist"

However, if I turn it on and just reset the opcache anytime I need to see the new changes, they are displayed correctly and I can see in my composer autoload classmap that they are loaded ie

'SettingRepository' => $baseDir . '/app/repositories/SettingRepository.php',

Any ideas what I am doing wrong? I feel like its configuration in apache is wrong, but I'm not sure any suggestions?

+3


source to share


1 answer


Enable it and install opcache.revalidate_freq=0

and restart apache

Or

Place the following in your laravel app to disable laravel-only caching and only in your debug environment:



if (env('APP_DEBUG')) ini_set('opcache.revalidate_freq', '0');

      

Perhaps you need to change APP_DEBUG

to your environment.

0


source







All Articles