/* no supported SAPI found - disable acceleration and stop initalization */
if( accel_find_sapi(TSRMLS_C) == FAILURE ){
ZCG(startup_ok) = 0;
- zps_startup_failure("Opcode Caching is only supported in Apache, ISAPI and FastCGI SAPIs", NULL, accelerator_remove_cb TSRMLS_CC);
+ if (!ZCG(accel_directives).enable_cli &&
+ strcmp(sapi_module.name, "cli")==0) {
+ zps_startup_failure("Opcode Caching is disabled for CLI", NULL, accelerator_remove_cb TSRMLS_CC);
+ } else {
+ zps_startup_failure("Opcode Caching is only supported in Apache, ISAPI, FPM and FastCGI SAPIs", NULL, accelerator_remove_cb TSRMLS_CC);
+ }
return SUCCESS;
}
} else {
php_info_print_table_row(2, "Opcode Caching", "Disabled");
}
- if (ZCG(enabled) && ZCG(accel_directives).optimization_level) {
+ if (ZCG(enabled) && ZCG(startup_ok) && ZCSG(accelerator_enabled) && ZCG(accel_directives).optimization_level) {
php_info_print_table_row(2, "Optimization", "Enabled");
} else {
php_info_print_table_row(2, "Optimization", "Disabled");