PHP: Disable APC Module At Command Line CLI Scripts / Cron Scripts

To disable the APC (Alternative PHP Cache) module in PHP command line scripts or cron scripts, you need to add the following code at the beginning of your script:

<?php
ini_set('apc.enabled', 0);
// rest of your script here
?>

This sets the apc.enabled configuration option to 0 for the current script, disabling the APC module for the duration of the script. The APC module will still be available for other scripts running on the same server.

Leave a Comment