当我设置锂项目(下面的过程)并启动PHP Web服务器时,我在框架的欢迎页面上获得了Apc disable(Apc✗)的信息。
但是我运行sed -ir "s/'apc'/'apcu'/" libraries/lithium/storage/cache/adapter/Apc.php
,然后我启用了Apc(Apc✓)。
此代码更改是否正确?不是吗?
详情:
$ rpm -qa | grep php
php-pdo-7.1.7-1.fc26.x86_64
php-pecl-apcu-devel-5.1.8-2.fc26.x86_64
php-7.1.7-1.fc26.x86_64
php-mysqlnd-7.1.7-1.fc26.x86_64
php-json-7.1.7-1.fc26.x86_64
php-devel-7.1.7-1.fc26.x86_64
php-cli-7.1.7-1.fc26.x86_64
php-pecl-apcu-5.1.8-2.fc26.x86_64
php-common-7.1.7-1.fc26.x86_64
$ composer.phar create-project --prefer-dist unionofrad/framework app
Installing unionofrad/framework (v1.1.1)
- Installing unionofrad/framework (v1.1.1): Loading from cache
Created project in app
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
- Installing composer/installers (v1.3.0): Loading from cache
- Installing unionofrad/lithium (v1.1.0): Loading from cache
Writing lock file
Generating autoload files
$ cd app/
$ php -S 0.0.0.0:8080 -t app/webroot index.php
.orig文件是备份。
/etc/php.ini中:
$ diff /etc/php.ini.orig /etc/php.ini
460c460,461
< error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
---
> ;error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
> error_reporting = E_ALL
/etc/php.d/40-apcu.ini:
$ diff /etc/php.d/40-apcu.ini.orig /etc/php.d/40-apcu.ini
9a10
> apc.enable_cli=1
-c /etc/php.ini
参数的使用参数运行,但没有效果,:
$ php -c /etc/php.ini -S 0.0.0.0:8080 -t app/webroot index.php
显示Apc禁用(Apc✗)。
答案 0 :(得分:0)
通过dnf安装php-pecl-apcu-bc
包使得适应Apc✓。但php-pecl-apcu-bc
是“APCu向后兼容模块”......哦。
安装前:
$ php -m
[PHP Modules]
apcu
bz2
calendar
Core
ctype
curl
date
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
readline
Reflection
session
sockets
SPL
sqlite3
standard
tokenizer
zlib
[Zend Modules]
安装后:
$ php -m
[PHP Modules]
apc
apcu
bz2
calendar
Core
ctype
curl
date
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
readline
Reflection
session
sockets
SPL
sqlite3
standard
tokenizer
zlib
[Zend Modules]