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

www.la‮iruttu‬.com
PHP: Disable APC Module At Command Line CLI Scripts / Cron Scripts

To disable the APC (Alternative PHP Cache) module in PHP at the command line for CLI scripts or cron scripts, you can use the php -d option to set a configuration directive at runtime.

The php -d option allows you to set a configuration directive at runtime, and overrides any value set in the php.ini file. To disable the APC module, you can use the apc.enabled directive.

Here is an example of how you can use the php -d option to disable the APC module for a CLI script:

# Run the script with the APC module disabled
php -d apc.enabled=0 script.php

This will run the script.php script with the APC module disabled.

You can also use the php -d option in a cron job to disable the APC module. For example:

# Run the script with the APC module disabled every hour
0 * * * * php -d apc.enabled=0 script.php

This will run the script.php script with the APC module disabled every hour.

Overall, the php -d option is a useful tool for disabling the APC module at the command line for CLI scripts or cron scripts. It allows you to override configuration directives at runtime, and can be used to disable the APC module as needed.

Created Time:2017-10-30 14:27:09  Author:lautturi