php 提速工具eAccelerator 配置參數(shù)詳解
Jun 13, 2016 pm 12:16 PM
eaccelerator.shm_size="32"
eAccelerator 可以使用的共享內(nèi)存的數(shù)量 (以兆為單位) . "0" 是指操作系統(tǒng)的默認(rèn)值. 默認(rèn)值是 "0".可根據(jù)服務(wù)器的實(shí)際情況來調(diào)整,16,32,64,128都是可以的。
eaccelerator.cache_dir="/home/php/tmp"
這個(gè)目錄是給磁盤緩存使用. eAccelerator 在這里儲存預(yù)先編譯好的代碼, 進(jìn)程數(shù)據(jù), 內(nèi)容以及用戶的自定義內(nèi)容. 同樣的數(shù)據(jù)也能被儲存在共享內(nèi)存中 (這樣可以提高訪問速度). 默認(rèn)的設(shè)置是 "/tmp/eaccelerator".
eaccelerator.enable="1"
開啟或關(guān)閉 eAccelerator。"1" 為開啟,"0" 為關(guān)閉。默認(rèn)值為 "1"。
eaccelerator.optimizer="1"
啟或關(guān)閉內(nèi)部優(yōu)化器,可以提升代碼執(zhí)行速度。"1" 為開啟,"0" 為關(guān)閉。默認(rèn)值為 "1"。
eaccelerator.check_mtime="1"
打開或者關(guān)閉 PHP 的文件修改檢查. "1" 是指打開, "0" 是指關(guān)閉. 如果您在修改以后重新編譯 PHP 的文件,那么您應(yīng)當(dāng)設(shè)置為 "1". 默認(rèn)值是 "1".
eaccelerator.debug="0"
開啟或關(guān)閉調(diào)試日志記錄。"1" 為開啟,"0" 為關(guān)閉。默認(rèn)值為 "0"。會將緩存命中得記錄寫入日志。
eaccelerator.filter=""
判斷哪些 PHP 文件必須緩存。您可以指定緩存和不緩存的文件類型(如 "*.php *.phtml"等)
如果參數(shù)以 "!" 開頭,則匹配這些參數(shù)的文件被忽略緩存。默認(rèn)值為 "",即,所有 PHP 文件都將被緩存。
eaccelerator.shm_max="0"
當(dāng)使用 " eaccelerator_put() " 函數(shù)時(shí)禁止其向共享內(nèi)存中存儲過大的文件。該參數(shù)指定允許存儲的最大值,單位:字節(jié) (10240, 10K, 1M)。"0" 為不限制。默認(rèn)值為 "0"。
eaccelerator.shm_ttl="0"
當(dāng) eAccelerator 獲取新腳本的共享內(nèi)存大小失敗時(shí),它將從共享內(nèi)存中刪除所有在最后 "shm_ttl" 秒內(nèi)沒有存取的腳本緩存。默認(rèn)值為 "0",即:不從共享內(nèi)春中刪除任何緩存文件。
eaccelerator.shm_prune_period="0"
當(dāng) eAccelerator 獲取新腳本的共享內(nèi)存大小失敗時(shí),他將試圖從共享內(nèi)存中刪除早于"shm_prune_period" 秒的緩存腳本。默認(rèn)值為 "0",即:不從共享內(nèi)春中刪除任何緩存文件。
eaccelerator.shm_only="0"
允許或禁止將已編譯腳本緩存在磁盤上。該選項(xiàng)對 session 數(shù)據(jù)和內(nèi)容緩存無效。默認(rèn)值為 "0",即:使用磁盤和共享內(nèi)存進(jìn)行緩存。
eaccelerator.compress="1"
允許或禁止壓縮內(nèi)容緩存。默認(rèn)值為 "1",即:允許壓縮。
eaccelerator.compress_level="9"
指定內(nèi)容緩存的壓縮等級。默認(rèn)值為 "9",為最高等級。
eaccelerator.keys = "disk_only"
eaccelerator.session = "disk_only"
eaccelerator.content = "disk_only"
設(shè)置內(nèi)容緩存的存放的地方,可以設(shè)置為:
shm_and_disk 在共享緩存和硬盤(默認(rèn)值)
shm 默認(rèn)存在共享內(nèi)存,如果共享內(nèi)存已滿或大小超過 "eaccelerator.shm_max" 的值,就存到硬盤
shm_only 只存放在共享內(nèi)存
disk_only 只存放在硬盤
none 不緩存數(shù)據(jù)
eaccelerator.allowed_admin_path = "/var/www/html/21andy.com/eaccelerator"
這是控制面板的地址
安裝包里有個(gè)control.php,你把它復(fù)制到網(wǎng)站的任意目錄,可以用它查看和管理,這個(gè)必須指定,否則查看緩存內(nèi)容的時(shí)候會出錯(cuò)
最后,來看一下我的 eAccelerator 設(shè)置
復(fù)制代碼 代碼如下:
; eaccelerator
[eaccelerator]
zend_extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="128"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.keys = "disk_only"
eaccelerator.sessions = "disk_only"
eaccelerator.content = "disk_only"
eaccelerator.allowed_admin_path = "/var/www/html/21andy.com/eaccelerator"
另外,再說下 eAccelerator 的安裝
# wget http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6.tar.bz2
# tar -jxvf eaccelerator-0.9.6.tar.bz2
# cd eaccelerator-0.9.6
# /usr/local/php/bin/phpize
# ./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config
# make && make install

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











Ageneratorinphpisamemory- ???? Way-Erate-Overgedatasetsetsbaluesoneatimeatimeatimeatimallatonce.1.generatorsuseTheyieldKeywordTocroadtOpvaluesondemand, RetingMemoryUsage.2

urlencode () ??? ???? URL-SAFE ???? ????? ? ????, ? ??? ? ?? (-, _ ?.)? ??? ??? ?? ? ?? 2 ?? 16 ?? ??? ?????. ?? ??, ??? ????? ???? ????!? ???? ???? UTF-8 ??? ???? ?????. ???? ?? URL ??? ???? ??? ?? ?? ? ? ?? URL? ?? ?????????. ?? ????? ?? URL? ?? ??? ?? ??? ???? rawurlencode () ??? ???????. ?? ?? ??? ?? ? ? http_build_query ()? ???? ? ??? ???? ?????? UrlenCode ()? ???? ???? ???? ???? ??? ? ????. ??

PHP?? ?? ??? ????? ?? ??? ??????. 1. HTTPS? ???? ?? ? ?? ??? ?????? .Cookie_Secure = 1?? php.ini; 2. Httponly, Secure ? Samesite? ??? ?? ?? ??? ??????. 3. ???? ?????? ??? ?? ? ? Session_Regenerate_id (true) Call Session_Regenerate_id (true) SessionID ??? ?????. 4. ?? ????? ???? GC_MAXLIFETIME? ????? ???? ???? ?? ??? ??????. 5. SessionID? URL? ????? ?? ???? Session.use_only? ??????.

substr () ?? mb_substr ()? ???? PHP?? ? ?? N ??? ?? ? ????. ?? ??? ??? ????. 1. Substr ($ string, 0, n)? ???? ASCII ??? ???? ???? ??????. 2. ?? ??? ?? (? : ???), MB_Substr ($ string, 0, N, 'UTF-8')? ?? ? ? MBString Extension? ????? ??? ?????. 3. ???? html ?? whitespace ??? ?? ? ?? ?? Strip_tags ()? ???? ??? ???? trim ()? ???? ??? ?? ? ?? ??? ??? ? ???????.

?? ???? ?? ?? ?? ???? ????. 1. ?? ?? ?? ? ?? ??? ?? ? ??? ???, ??? ?? ??? ??? ?? ???? ??? ?????. 2. ???? ?? ?? ?? ????? ????, ??? ?? ?? ? ?? ?? ???, ????? ??? ?? ??, ??? ?? ?? ??? ? ??? ?? ??? ?? ???? ?? ?? ? ??????? ???????. 3. ???? ??? ?? ??? ??? ?? ??? ??? ?? ???? ??? ??? ?? ? ???? ??? ??, ??? ??, ?? ??, ?? ?? ? ?? ?? ??? ???????. 4.? ???? ?? ?? ?? ?, ?? ??? ? ?? ??? ?? ??? ??? ???? ?? ??? ???? ????. 5. ???? ???? ??? ????? ?? ??? ????? ?? ?????.

php : 1?? ???? ??? n ??? ?? ? ?? ?? ??? ????. substr () ??? ???? ?? ?? ??? ?? ??? ?? ??? ??? ?????. 2. MB_SUBSTR () ??? ???? ??? ? UTF-8 ???? ???? ??? ?? ??? ???? ?? ?????. 3. ????? ??? ??? ?? ??? ????? ??? ? ??? ?????. 4. Multi-Byte ??? ???? ?? ?????? ?? ??? strrev () substr () ?? ??? ???? ?? ????.

PHP??? ???? ??? ?? ?? ????? ???? ??? ?? ??? ??? ?? ? ??? ??? ???? ?????. ???? 0?? ???? ?? ??? ???? ? ?? ???? ?? ?? ? ? ????. MB_SUBSTR? ?? ??? ??? ???????. ? : $ str = "hello"; echo $ str [0]; ?? H; ??? MB_SUBSTR ($ str, 1,1)? ?? ??? ??? ??? ??????. ?? ???????? ???? ??? ???? ?? ???? ?? ?? ???? ?????? ??? ????? ?? ??? ?? ??? ???? ???? ?? ????.

?? ?? ??? ? ?? ??? ?? ?? ??? ??? ????. ??, ?? ?? ??, ?? ??? ??? ???? ?? ? ?? ?? ??? ?????. 1. ?? ? ??? : ??? ??? ??? ??? ??? ??? ??? ??????. 2. ?? ?? ?? : ??? ??? ???? ?? ??? ??? ??? ???????. 3. ?? ??? ?? : ?? ?? ???? ?? ?? ???? ?? ??? ?????. 4. ?? ? ?? ??? ?? : ??? ?????? ??? ? ??? ??? ??? ?????.
