当前位置:网站首页>New features of PHP: bytecode cache and built-in server
New features of PHP: bytecode cache and built-in server
2022-06-24 07:42:00 【User 2323866】
Zend OPcache 1). from PHP5.0// Start , Built in bytecode cache function , be known as Zend OPcache. because PHP It's an explanatory language ,PHP The interpreter performs PHP The script will parse PHP Script code , Generate a series of Zend opcode , Then execute bytecode , Every time the HTTP All requests are like this , It will consume a lot of resources , Use bytecode cache to cache precompiled bytecode , Reduced response time , Reduce the pressure on system resources . Enable Zend OPcache By default ,Zend OPcache It didn't start . If you compile it yourself PHP, When executed, the command must contain the following options :
--enable-opcache
Compile well PHP after , Must also be in php.ini The document specifies Zend OPcac/【php course _linux Common commands _ Network operation and maintenance technology 】/he The extension path of , As shown below :
zend_extension=/path/to/opcache.so
PHP After the compilation is successful, it will display Zend OPcache Extended file path . You can find this by using the following command PHP Extended path
php-config --extension-dir
Then use the following code to confirm that the extension is working properly
<?php phpinfo();
To configure Zend OPcache The recommended configuration
opcache.validate_timestamps = 1 // Set to... In the production environment '0' opcache.revalidate_freq = 0 opcache.memory_comsumption = 64 opcache.interned_strings_buffer = 16 opcache.max_accelerated_files = 4000 opcache.fast_shutdown = 1
You can visit PHP See the detailed settings on the official website . Use Zend OPcache 1). The production environment can be set up opcache.validate_timestamps=0. In the development environment, it needs to be set to 1 Built in HTTP The server 1). start-up php -S localhost:4000 -c app/config/php.ini 2). I won't support it .htaccess file . This means that the controller mode is not supported . The front controller is used to forward all HTTP request , Need to pass through .htaccess File or rewrite rule implementation . 3). You can use router scripts to achieve the above functions . But only a small number of URL Rewriting rule php -S localhost:8000 router.php 4). Determine which server to use :
<?php if (php_sapi_name() === 'cli-server') { //php Built in server } else { // other Web The server }
Special series PHP Special series directory address : github.com/xx19941215/… PHP About 20 articles are expected to be written in the special series , Mainly our daily PHP Basic knowledge and modern knowledge that are easy to ignore in development PHP Specifications in development 、 Deploy 、 Some practical suggestions for optimization , At the same time, it's right Javascript An in-depth study of language features .
The above is a brief introduction PHP New features of bytecode cache and built-in server , I hope that's helpful , If you have any questions, please leave me a message , Xiaobian will reply to you in time . Thank you very much for your support of script House website
边栏推荐
- 后疫情时代下,家庭服务机器人行业才刚启航
- [understanding of opportunity -29]: Guiguzi - internal dialogue - five levels of communication with superiors
- Actual target shooting - skillfully use SMB to take down the off-line host
- 【Vulhub靶场】】zabbix-SQL注入(CVE-2016-10134)漏洞复现
- Quickly set up PgSQL for serverless
- 《canvas》之第2章 直线图形
- L2TP connection failure guide in VPN
- 向量操作与坐标转换相关方法
- How to realize high stability and high concurrency of live video streaming transmission and viewing?
- PCL calculates the area of a polygon
猜你喜欢

RDD basic knowledge points

get_ started_ 3dsctf_ two thousand and sixteen
![[frame rate doubling] development and implementation of FPGA based video frame rate doubling system Verilog](/img/38/92486c92557e6e5a10a362eb2b7bdf.png)
[frame rate doubling] development and implementation of FPGA based video frame rate doubling system Verilog
![[image fusion] image fusion based on directional discrete cosine transform and principal component analysis with matlab code](/img/21/a5a973f06ea002755a8a2a4431dcd8.png)
[image fusion] image fusion based on directional discrete cosine transform and principal component analysis with matlab code
![[pointnet] matlab simulation of 3D point cloud target classification and recognition based on pointnet](/img/86/5db689cdac2a927a23dff3fb9594b0.png)
[pointnet] matlab simulation of 3D point cloud target classification and recognition based on pointnet

爬虫基础B1——Scrapy(B站学习笔记)

屏幕截图推荐—Snipaste
![Selector (>, ~, +, [])](/img/7e/2becfcf7a7b2e743772deee5916caf.png)
Selector (>, ~, +, [])
![[mrctf2020] thousand layer routine](/img/8e/d7b6e7025b87ea0f43a6123760a113.png)
[mrctf2020] thousand layer routine

LeetCode 207:课程表(拓扑排序判断是否成环)
随机推荐
chrono 使用备注
MaxCompute远程连接,上传、下载数据文件操作
[wustctf2020] climb
Deploy L2TP in VPN (Part 2)
C code writing specification
[mrctf2020] thousand layer routine
How to select a third-party software testing company? 2022 ranking of domestic software testing institutions
【NILM】非入侵式负荷分解模块nilmtk安装教程
The first common node of two linked lists_ The entry of the link in the linked list (Sword finger offer)
使用SystemParametersInfo访问用户界面设置
Combine with (& &) logic or (||), dynamic binding and ternary operation
[MySQL usage Script] clone data tables, save query data to data tables, and create temporary tables
What is automated testing? What software projects are suitable for automated testing?
[equalizer] bit error rate performance comparison simulation of LS equalizer, def equalizer and LMMSE equalizer
UE common console commands
Reconfiguration of nebula integration testing framework based on BDD theory (Part 2)
jarvisoj_ level2
How to turn on win11 notebook power saving mode? How to open win11 computer power saving mode
Camera calibration (calibration purpose and principle)
Global and Chinese market of basketball uniforms 2022-2028: Research Report on technology, participants, trends, market size and share