how to get php cli processes share variables via apc

▼魔方 西西 提交于 2020-01-07 05:43:06

问题


i have apc.enable_cli=1 in php.ini for cli;

i tested sharing variables with apc with this script:

<?php
$apctest=apc_fetch('apctest');
echo "apctest was " . $apctest;
echo "\n";
if($argc>1){
    $newval=$argv[1];
}else{
    $newval='ok';
}
echo "setting apctest to " . $newval;
echo "\n";
apc_store('apctest',$newval);
sleep(30);

i runned it with

php test_cli_apc.php > /dev/null &

and then within 30 seconds runned

php test_cli_apc.php

but it has outputted "apctest was " , not "apctest was ok"

i have tried same script with "apc" changed to "apcu" but it also does not work in same way.

来源:https://stackoverflow.com/questions/45129579/how-to-get-php-cli-processes-share-variables-via-apc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!