当前位置:网站首页>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
边栏推荐
- Extend ado Net to realize object-oriented CRUD (.Net core/framework)
- Global and Chinese market of water massage column 2022-2028: Research Report on technology, participants, trends, market size and share
- Wechat cloud hosting hot issues Q & A
- Spark stage and shuffle for daily data processing
- UTC、GMT、CST
- 图形技术之管线概念
- MFC multithreaded semaphore csemaphore critical area and mutually exclusive events
- Hubei College Upgraded to undergraduate - Hushi family planning department
- Mysql database recovery case sharing
- L2TP connection failure guide in VPN
猜你喜欢

How can win11 set the CPU performance to be fully turned on? How does win11cpu set high performance mode?

Camera calibration (calibration purpose and principle)

Combine with (& &) logic or (||), dynamic binding and ternary operation

bjdctf_2020_babystack

Shader 常用函数

bjdctf_ 2020_ babystack
![[vulhub shooting range]] ZABBIX SQL injection (cve-2016-10134) vulnerability recurrence](/img/c5/f548223666d7379a7d4aaed2953587.png)
[vulhub shooting range]] ZABBIX SQL injection (cve-2016-10134) vulnerability recurrence

How to turn on win11 notebook power saving mode? How to open win11 computer power saving mode

How to open the soft keyboard in the computer, and how to open the soft keyboard in win10

MaxCompute远程连接,上传、下载数据文件操作
随机推荐
Global and Chinese market of Earl Grey tea 2022-2028: Research Report on technology, participants, trends, market size and share
向量操作与坐标转换相关方法
timer使用备注
PIP install XXX on the terminal but no module named XXX on pycharm
MaxCompute远程连接,上传、下载数据文件操作
A case of bouncing around the system firewall
[Proteus] Arduino uno + ds1307+lcd1602 time display
《canvas》之第4章 线条操作
与(&&)逻辑或(||),动态绑定结合三目运算
Phonics
Camera calibration (calibration purpose and principle)
【MySQL 使用秘籍】克隆数据表、保存查询数据至数据表以及创建临时表
The first common node of two linked lists_ The entry of the link in the linked list (Sword finger offer)
[WUSTCTF2020]alison_likes_jojo
Bjdctf 2020 Bar _ Babystack
MySQL case: analysis of full-text indexing
PCL point cloud random sampling by ratio
Description of module data serial number positioning area code positioning refers to GBK code
get_started_3dsctf_2016
图形技术之管线概念