18 lines
521 B
PHP
18 lines
521 B
PHP
|
<?php
|
||
|
if (!extension_loaded('Zend OPcache')) {
|
||
|
echo json_encode(['status' => 'error', 'message' => 'OPCache is not installed']);
|
||
|
exit(1);
|
||
|
}
|
||
|
|
||
|
if (!ini_get('opcache.enable')) {
|
||
|
echo json_encode(['status' => 'error', 'message' => 'OPCache is disabled']);
|
||
|
exit(1);
|
||
|
}
|
||
|
|
||
|
$result = opcache_reset();
|
||
|
if ($result === false) {
|
||
|
echo json_encode(['status' => 'error', 'message' => 'Failed to reset OPCache']);
|
||
|
exit(1);
|
||
|
}
|
||
|
|
||
|
echo json_encode(['status' => 'success', 'message' => 'OPCache cleared successfully']);
|