File tree Expand file tree Collapse file tree 4 files changed +25
-24
lines changed
assets/environment/source/php/configure Expand file tree Collapse file tree 4 files changed +25
-24
lines changed Original file line number Diff line number Diff line change 1- ' configure' configures PHP 8.4.12 to adapt to many kinds of systems.
1+ ' configure' configures PHP 8.4.14 to adapt to many kinds of systems.
22
33Usage: ../configure [OPTION]... [VAR =VALUE]...
44
Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ titleTemplate: 环境搭建教程
4242 - 动态扩展
4343 - xdebug-3.4.7.tgz
4444 - apcu-5.1.27.tgz
45- - yaml-2.2.5.tgz
46453. nginx-1.28.0.tar.gz
4746 - openssl-3.5.4.tar.gz
4847 - pcre2-10.47.tar.bz2
Original file line number Diff line number Diff line change @@ -28,9 +28,9 @@ PHP(`PHP: Hypertext Preprocessor`,超文本预处理器的字母缩写)是
2828
2929``` bash [84]
3030su - php-fpm -s /bin/zsh
31- tar -xJf php-8.4.12 .tar.xz
32- mkdir /home/php-fpm/php-8.4.12 /build_php
33- cd /home/php-fpm/php-8.4.12 /build_php/
31+ tar -xJf php-8.4.14 .tar.xz
32+ mkdir /home/php-fpm/php-8.4.14 /build_php
33+ cd /home/php-fpm/php-8.4.14 /build_php/
3434```
3535
3636:::
@@ -194,7 +194,7 @@ php 编译完成后,在源码包根目录下会自动生成两个推荐的配
194194::: code-group
195195
196196``` bash [84]
197- cp /home/php-fpm/php-8.4.12 /php.ini-* /server/php/84/lib/
197+ cp /home/php-fpm/php-8.4.14 /php.ini-* /server/php/84/lib/
198198# 开发环境
199199cp /server/php/84/lib/php.ini{-development,}
200200# 部署环境
Original file line number Diff line number Diff line change 55``` bash [解压扩展包]
66tar -xzf apcu-5.1.27.tgz
77tar -xzf xdebug-3.4.5.tgz
8- tar -xzf yaml-2.2.5.tgz
98```
109
1110``` ini [84配置扩展]
1211; path /server/php/84/lib/php.ini
13- extension =yaml
1412extension =apcu
1513
1614; zend_extension=opcache
@@ -35,12 +33,10 @@ apc.enable_cli=1
3533``` bash [测试扩展]
3634# 测试加入环境变量的 PHP 版本的扩展
3735php --ri xdebug
38- php --ri yaml
3936php --ri apcu
4037
4138# 测试指定PHP版本的扩展
4239/server/php/84/bin/php --ri xdebug
43- /server/php/84/bin/php --ri yaml
4440/server/php/84/bin/php --ri apcu
4541```
4642
@@ -60,22 +56,9 @@ make install
6056
6157:::
6258
63- ### 2. yaml 扩展
64-
65- ::: code-group
66-
67- ``` bash [84]
68- cd /home/php-fpm/php_ext/yaml-2.2.5
69- /server/php/84/bin/phpize
70- ./configure --with-php-config=/server/php/84/bin/php-config
71- make -j4 > make.log
72- make test
73- make install
74- ```
75-
7659:::
7760
78- ### 3 . apcu 扩展
61+ ### 2 . apcu 扩展
7962
8063::: code-group
8164
@@ -88,4 +71,23 @@ make test
8871make install
8972```
9073
74+ ``` ini [配置参考]
75+ ; 开发环境配置
76+ apcu.enabled =1
77+ apcu.shm_size =64M
78+ apcu.stat =1 ; 开发时开启文件检查
79+ apcu.ttl =300 ; 短时间缓存,便于调试
80+
81+ ; 生产环境配置
82+ apcu.enabled =1
83+ apcu.shm_size =256M
84+ apcu.stat =0 ; 关闭状态检查提升性能
85+ apcu.ttl =7200 ; 长时间缓存
86+ apcu.slam_defense =1 ; 防止缓存击穿
87+ ```
88+
89+ :::
90+
91+ ::: warning 说明
92+ yaml 格式的配置文件性能并没有 php 格式的配置文件好,所以这里就不考虑安装 yaml 库了
9193:::
You can’t perform that action at this time.
0 commit comments