CodeIgniter Forums

Full Version: Note on using the new opcache
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If you are using the new opcache in php 7 etc;

You will need to create a file to clear the cache or your development updates will not
work. Everything will be pulled from the cache so when making changes you will need
to run the below file first.

flush_opcache.php

PHP Code:
<?php

opcache_reset
(); 

Place it in the root along with index.php
(06-26-2019, 03:08 AM)InsiteFX Wrote: [ -> ]If you are using the new opcache in php 7 etc;

You will need to create a file to clear the cache or your development updates will not
work. Everything will be pulled from the cache so when making changes you will need
to run the below file first.

flush_opcache.php

PHP Code:
<?php

opcache_reset
(); 

Place it in the root along with index.php

I think (but have not confirmed) that a couple of php.ini settings will accomplish the same thing.

Code:
opcache.validate_timestamps=1
opcache.revalidate_freq=0

Documentation
Thanks Dave,

Those seem to work but they would need to be changed for a live server.

Thanks again.
(06-27-2019, 07:47 AM)InsiteFX Wrote: [ -> ]Thanks Dave,

Those seem to work but they would need to be changed for a live server.

Thanks again.

Right, those are the development settings only.