您的位置 首页 php

PHP生命周期及fpm的运作方式

PHP生命周期及fpm(FastCGI进程管理器)的运作方式

PHP在web方式中如何改了文件就立即生效的,重要的几个概念:

● sapi: 可以简单的理解为php引擎对外的一个统一接口,使得php可以和外部程序进行交互

● php的生命周期中关键四个调用: MINT -> RINT -> RSHUTDOWN -> MSHUTDOWN

● fpm: fastcgi进程管理器

fpm方式的流程就是:

fpm通过sapi接口与php进程交互

1.fpm启动会调用各扩展的MINT方法,进行一些数据初始化(长驻内存)

2.每个请求过来,先会执行RINT对单个请求行一个初始化

3.执行php脚本(在没有缓存opcode的情况下,这里的php脚本是动态执行的,所以更新php脚本后,会执行新的php脚本,详情不在这里叙述)

4.执行RSHUTDOWN方法

5.如果你要停止fpm了,才会执行MSHUTDOWN

fpm对每个请求的处理都是一直在在重复执行 2~4步,在第三步中,php的脚本是动态执行的,由于每次都要执行一次php脚本,而每次php脚本都要有一个把php文件翻译成opcode的流程(比较耗时), 于是就产生的opcache工具。

opcache

直接把php翻译后的opcode代码树保存到共享内存中,以便直接使用,从而减少每次都把php翻译成opcode的开销。

opcache的问题: 按照他的描述,修改了php文件,并不能立即被更新。

opcache的解决方案: 有一个配置来设置隔多长时间检测文件是否更新了,从而有机会在第二步重新来reload相关的文件。

当然,直接reload fpm,从而达到php热更新的效果(opcache扩展可以在第四步把相关的opcode cache给清空)。

图示

0a3f5bc11b74f00c471f709da262377.png

更多PHP相关知识,请访问PHP教程!

以上就是PHP生命周期及fpm的运作方式的详细内容,更多请关注求知技术网其它相关文章!

文章来源:智云一二三科技

文章标题:PHP生命周期及fpm的运作方式

文章地址:https://www.zhihuclub.com/2339.shtml

关于作者: 智云科技

热门文章

评论已关闭

84条评论

  1. Definitely believe that which you said. Your favorite justification seemed to be on the web the easiest thing to be aware of. Guendolen Norbert Arman

  2. I really like your writing style, fantastic information, regards for posting : D. Suzanna Orlando Zel

  3. Good thoughts and great article. You are bang on point. I come from the so-called 3rd world country and I can totally relate to what you are saying. Laurel Inglis Hayden

  4. Here are some hyperlinks to internet sites that we link to mainly because we feel they are worth visiting. Addi Ethelbert Evangeline

  5. The most typical loans are those accustomed to purchase a home, a mortgage, car finance, and to pay for student tuition. Ester Niels Lundeen

  6. You made some decent points there. I did a search on the subject and found most guys will agree with your blog. Jeannette Ermin Benedix

  7. Every weekend i used to go to see this web page, as i wish for enjoyment, as this this web page conations truly nice funny information too. Nelia Briano Bel

  8. I am in fact delighted to read this website posts which includes lots of valuable information, thanks for providing such data. Carlee Brnaba Johannes

  9. The cleaning firm carries out cleansing of areas of different sizes as well as arrangements. Lenna Lutero Medeah

  10. I think the admin of this website is really working hard in favor of his website, since here every stuff is quality based information. Angele Goraud Kellia

  11. This post gives clear idea for the new people of blogging, that in fact how to do blogging and site-building. Lynda Dunc Wood

  12. This article offers clear idea in support of the new viewers of blogging, that genuinely how to do blogging and site-building. Kristin Kelvin Natascha

  13. I am regular visitor, how are you everybody? This article posted at this site is actually fastidious. Elianore Royall Gorlicki

  14. I every time used to read piece of writing in news papers but now as I am a user of net therefore from now I am using net for articles, thanks to web. Merola Monro Alyson

  15. You made some good points there. I looked on the net for more info about the issue and found most people will go along with your views on this site. Pearle Waverly Yolane

  16. Thank you, I believe men should read this post also, because this is not just something women deal with. Emilee Ferdy Aube

  17. Only wanna remark on few general things, The website design and style is perfect, the content material is rattling great : D. Casie Bronson Grayce

  18. Definitely believe that that you said. Your favorite justification seemed to be at the web the easiest factor to consider of. Yvonne Laurie Kimbra

  19. I have been examinating out some of your stories and i can claim nice stuff. I will surely bookmark your website. Jeanelle Jeddy Addis

  20. Took me time to read the material, but I truly loved the article. It turned out to be very useful to me. Demeter Luciano Maybelle

  21. roin commodo faucibus ante ut lobortis. Nunc neque urna, cursus in scelerisque in, semper ut lacus. Bobbie Cammy Balf

  22. Its great as your other blog posts :D, appreciate it for posting. Nisse Phillipe Barbie

  23. hi!,I love your writing very so much! share we communicate extra approximately your article on AOL? I require an expert on this house to resolve my problem. Maybe that is you! Having a look forward to peer you. Nanon Gustave Zullo

  24. Excellent read, I just passed this onto a friend who was doing some research on that. And he just bought me lunch as I found it for him smile Thus let me rephrase that: Thanks for lunch! Salomi Isak Hedwiga

  25. I love it when people come together and share opinions. Great blog, keep it up! Malena Harper Kruter

  26. Someone essentially help to make seriously posts I would state. This is the first time I frequented your web page and thus far? I amazed with the research you made to make this particular publish amazing. Wonderful job! Maggy Elton Britt

  27. This is an example of a comment made on a post. You can either edit the comment, delete the comment or reply to the comment. Use this as a place to respond to the post or to share what you are thinking. Deeyn Udall Aldora

  28. I think the admin of this web site is in fact working hard in favor of his web site, as here every information is quality based stuff. Joanna Warde Costanzia

  29. SMM, kendinizi veya şirketinizi tanıtmak için Instagram, Facebook, Twitter, Youtube ve daha pek çok sosyal medya platformunun kullanılmasıdır. Çevrimiçi varlığınızı artırmanın bir yolunu arıyorsanız, en iyi ve en ucuz fiyatlarla panelimizi kullanabilirsiniz.

  30. PDF kitap indir, ücretsiz PDF kitapları indirme sitesi. İnternette arayıp bulamadığınız tüm PDF kitaplar burada. Ücretsiz Pdf Kitap indir ve Oku. Yandex Disk E Kitap Arşivi İndirme Sitesi! Ücretsiz PDF formatında e-kitap indirebileceğiniz paylaşım sitesi. inlerce PDF Kitap indir içeriğini, EPUB Kitap ve PDF Kitap formatlarıyla sitemizde bulabilirsiniz! Dilediğiniz kitabı ücretsiz bir şekilde okuyabilirsiniz.

  31. Aenean lectus elit, fermentum non, convallis id, sagittis at, neque. Nullam mauris orci, aliquet et, iaculis et, viverra vitae, ligula. Nulla ut felis in purus aliquam imperdiet. Maecenas aliquet mollis lectus

  32. I am constantly searching online for articles that can help me. Thank you! I Peter Lucax Nonahs

  33. Some genuinely nice and useful info on this internet site, as well I conceive the layout contains excellent features. Emma Tiger

  34. Mengapa saya berbicara tentang tenaga mesin? Ini adalah faktor utama kecepatan tertinggi yang tersedia untuk mobil Anda

  35. I am actually happy to read this weblog posts which consists of tons of helpful facts, thanks for providing these kinds of information.

  36. Awesome! Its truly amazing piece of writing, I have got much clear idea concerning from this article. Marigold

  37. Wow, that’s what I was looking for, what a information! present here at this
    blog, thanks admin of this site.

  38. Wow, that’s what I was looking for, what a information! present here at this
    blog, thanks admin of this site.

  39. wonderful post, very informative. I’m wondering why the opposite specialists of this sector don’t realize this.
    You should continue your writing. I am confident, you’ve a great readers’ base
    already!

  40. vgs33m 4xmv5 3ym4vr d6g7r yemi87 hdp2ha 3xduvo pngtme
    5okyq hol31 2pa8i txgnh5 8gx7z 65qnms b0kgpw nljr6
    kioi rbihlz skonvq tcb0kp w6i4to u62lzg 4arkvn gjuulo 7qfp vahyg2 9upk6a ipbq49 4p56hb omkza2

  41. I wil immediately gtab yoour rss aas I caan not to find ypur emai
    subscription hyperpink orr e-newsletter service.
    Do you have any? Please let mee realize in order that I could
    subscribe. Thanks.

  42. a membership service that will offer five downloadable content DLC packs, including Гў mTOR serine 2448 is phosphorylated in a feedback loop by mTORC1 substrate S6 kinase 1 45, 46, indicating elevated mTORC1 activity in the skeletal muscle of Myf5 Fktn KO compared to LC

  43. Percentage concordance for Ion S5, PharmacoScan, and Agena with AmpliChip CYP450 and CYP2C19 17 prior data by CYP2C19 genotype

  44. I was just seeking this information for a while. After six hours of continuous Googleing, finally I got it in your web site. I wonder what is the lack of Google strategy that don’t rank this type of informative sites in top of the list. Normally the top websites are full of garbage.

  45. Hasome, Synthesis of the new pseudo symmetrical tamoxifen derivatives and their anti tumor activity, Bioorg Med

  46. ponatinib increases levels of leflunomide by Other see comment At the same time, a new Treasury report says the IRS is opening more delinquent taxpayer accounts than it is closing

  47. betagan zoloft iskustva forum Actual negotiations for a new agreement begin on Wednesday in Manila and both sides hope to conclude talks this year, or after four rounds of discussions, Carlos Sorreta, head of the American desk at the foreign ministry, said

  48. She told CBC News in February that taking dandelion extract tea could interfere with regular chemotherapy, and she urged patients not to mix the natural remedy with other cancer drugs without speaking to a doctor first These double CKO mice showed more severe motor deficits, especially in terms of stride length and balance Fig 1E, 1H and 1I, and died from motor deficits much earlier than Atg7 CKO mice Fig 1J

  49. Something more important is that when looking for a good internet electronics store, look for online stores that are consistently updated, preserving up-to-date with the most recent products, the most effective deals, and also helpful information on services. This will ensure that you are doing business with a shop that stays ahead of the competition and provide you what you need to make knowledgeable, well-informed electronics buying. Thanks for the significant tips I’ve learned through your blog.

  50. Thanks for your article. My spouse and i have generally seen that a majority of people are desperate to lose weight because they wish to appear slim along with attractive. On the other hand, they do not always realize that there are more benefits so that you can losing weight in addition. Doctors claim that fat people are afflicted with a variety of disorders that can be perfectely attributed to their excess weight. The good news is that people that are overweight plus suffering from a variety of diseases can help to eliminate the severity of the illnesses through losing weight. It is easy to see a steady but noted improvement with health whenever even a bit of a amount of weight loss is realized.

  51. This year, a genomic profiling study identified recurrent genetic abnormalities that could potentially be targeted and blocked by existing drugs

  52. Activation of Akt ER alone is not sufficient to overcome inhibition of BCR induced IL 2 production by BCR FcОіRIIB1 co cross linking

  53. Some people are showing improvement while others aren t which is pretty typical 1998; 39 2 Pt 3 S17 24

  54. Swollen breasts As hormone levels change in the early stages of pregnancy, many women notice their breasts feel tender, achy, or uncomfortable

  55. adult contact swinger mesxsy erotic paint bridget marquardt nufe forums foxx bkack male escort big tits at wwork torrent free dawily fuyck storry asia foot massage las vegas

  56. Bland, PharmD, BCPS, FIDSA Clinical Associate Professor Clinical and Administrative Pharmacy University of Georgia College of Pharmacy Southeast Georgia Clinical Campus Clinical Pharmacy Specialist St

  57. Hi there, I m joining this thread in hopes of speaking to other people on Clomid We hypothesized that a stable body constitution during the first postoperative year after diagnosis would be associated with a favorable prognosis, but that associations might differ between subgroups of patients

  58. Monitor Closely 2 fosinopril increases toxicity of lithium by unknown mechanism Antibiotic Treatment Response in Chronic Lyme Disease Why Do Some Patients Improve While Others Do Not

  59. Malta Barber for impeccable men’s haircuts and grooming experiences. Our expert barbers skillfully blend modern and traditional techniques to craft unique looks that suit every individual’s style. Using carefully selected products and specialized grooming tools, we ensure a flawless shaving experience.

网站地图