使用 AutoIt3 在 Windows 下实现一个简单的 PHP-FPM

代码见真章,请勿直接用,按注释修改。

#NoTrayIcon

AutoItSetOption("MustDeclareVars", 1);限定变量必须先定义后使用,防止出错

;定义全局常量
Global Const $phpDir = "D:\Webserver\PHP53";PHP 路径
Global Const $phpFile = "php.exe";PHP 程序名
Global Const $phpExe = $phpDir & "\" & $phpFile;PHP 完整路径
Global Const $phpCgiFile = "php-cgi.exe";PHP-CGI 程序名
Global Const $phpCgiExe = $phpDir & "\" & $phpCgiFile;PHP-CGI 完整路径
Global Const $phpIniFile = "php.ini";PHP.INI 名
Global Const $phpIni = $phpDir & "\" & $phpIniFile;PHP.INI 完整路径

__onStart();运行前执行

OnAutoItExitRegister("__onExit");注册回调(退出后执行)

__main();执行主函数

Exit;退出

#comments-start
启动时运行函数
#comments-end
Func __onStart()

EndFunc ;==>__onStart

#comments-start
主函数
#comments-end
Func __main()
    If ($CmdLine[0] >= 1) Then
        __cmdMain()
        Exit
    EndIf
EndFunc ;==>__main

#comments-start
命令行主函数
#comments-end
Func __cmdMain()
    While 1
        If (__checkPhpCgiProcess() < $CmdLine[1]) Then
            __runPhpCgi($CmdLine[1] - __checkPhpCgiProcess())
        EndIf
        Sleep(10000)
    WEnd
EndFunc ;==>__cmdMain

#comments-start
退出时运行函数
#comments-end
Func __onExit()

EndFunc ;==>__onExit

#comments-start
检查 PHP-CGI 是否在运行
@return boolean 运行返回 true,否则返回 false
#comments-end
Func __checkPhpCgiState()
    Return ProcessExists($phpCgiFile)
EndFunc ;==>__checkPhpCgiState

#comments-start
检查 PHP-CGI 进程数
@return int 返回目前 PHP-CGI 进程数
#comments-end
Func __checkPhpCgiProcess()
    Local $phpCgiProcessArray = ProcessList($phpCgiFile)
    Return IsArray($phpCgiProcessArray) ? $phpCgiProcessArray[0][0] : 0;
EndFunc ;==>__checkPhpCgiProcess

#comments-start
运行 PHP-CGI
@param int $start 运行几个 PHP-CGI
#comments-end
Func __runPhpCgi($start = 3)
    Local $i = 1
    For $i = 1 To $start Step 1
        Run($phpCgiExe & " -b 127.0.0.1:9000", $phpDir, @SW_HIDE)
    Next
EndFunc ;==>__runPhpCgi

#comments-start
结束 PHP-CGI
#comments-end
Func __stopPhpCgi()
    While __checkPhpCgiState()
        __closePhpCgiProcess()
    WEnd
EndFunc ;==>__stopPhpCgi

#comments-start
结束 PHP-CGI 进程
#comments-end
Func __closePhpCgiProcess()
    ProcessClose($phpCgiFile)
EndFunc ;==>__closePhpCgiProcess
此文章是由nikbobo发表在PHP分类目录的。将固定链接加入收藏夹。

关于 nikbobo

Nikbobo,本名刘永强,记忆空间站长,男,1998 年出生于广东茂名,至今(2020 年)21 岁,目前(2020 年)就读于广州大学华软软件学院,常以“nikbobo”这个网名混迹互联网。如无特殊注明,Nikbobo 在本站发表的文章,遵循 知识共享 署名-非商业性使用-相同方式共享 4.0 国际 许可协议。详情请参阅关于页面的作者介绍。

使用 AutoIt3 在 Windows 下实现一个简单的 PHP-FPM》上有98个想法

  1. 好久不见,我最近发现了一款可以通过杀软锁主页软件,我想发给你研究一下。他的原理是什么。软件本身下载下来杀软都会拦截或者误杀。运行起来修改主页杀软虽然是有提示,但是最后还是被设置了。目前就360软件运行状态下无法设置主页。bobo什么时候有时间研究下。回复我信息。

    • 发到QQ邮箱,我看看,最近总算能有一点时间了,研究一下,不过我不干这个那么久了,还会不会也不保证。破出来就真的帅了。

  2. Way cool! Some extremely valid points! I appreciate you penning this write-up and the rest of the website is really good. Madonna Germayne Rowena

  3. Howdy, I believe your website could be having browser compatibility problems. Whenever I look at your web site in Safari, it looks fine however, if opening in Internet Explorer, it has some overlapping issues. I merely wanted to give you a quick heads up! Other than that, excellent blog! Celle Kelly Kalindi

  4. This paragraph will assist the internet people for setting up new weblog or even a blog from start to end. Elnore Javier Itagaki

  5. Thank you for this. I remind myself that this virus is the great equalizer. Rich, poor, young, old. We are all in this together. Saidee Brodie Natelson

  6. When I originally left a comment I appear to have clicked the -Notify me when new comments are added- checkbox and from now on every time a comment is added I receive four emails with the same comment. Is there a means you are able to remove me from that service? Thanks! Essa Duky Janka

  7. It is actually a great and helpful piece of info. I am happy that you shared this useful information with us. Please stay us informed like this. Thank you for sharing. Cecilla Royal Novello

  8. Hey there. I discovered your blog by way of Google even as searching for a similar topic, your site got here up. It seems great. I have bookmarked it in my google bookmarks to come back then. Dulcie Loy Fredra

  9. Thanks for sharing your thoughts. I truly appreciate your efforts and I am waiting for your further write ups thanks once again. Koo Bord Yalonda

  10. I together with my pals have been studying the good tricks located on your web blog and so then I got a horrible suspicion I had not expressed respect to the site owner for them. The young men are actually as a result warmed to read all of them and have in effect pretty much been using those things. Appreciation for actually being well kind and also for making a choice on certain useful issues most people are really eager to understand about. My personal sincere apologies for not expressing gratitude to you earlier. Collen Marco Bob

  11. Wow, marvelous blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your web site is magnificent, as well as the content! Danella Waverley Edra

  12. Definitely believe that which you stated. Your favorite reason seemed to be on the internet the simplest thing
    to be aware of. I say to you, I certainly get
    irked while people think about worries that they just do not know about.
    You managed to hit the nail upon the top and defined out the whole thing without having side-effects , people can take a signal.
    Will likely be back to get more. Thanks

  13. I seriously love your blog.. Pleasant colors &
    theme. Did you create this site yourself? Please reply back as I’m planning to create my own personal blog and would
    like to find out where you got this from or what the theme is
    called. Appreciate it!

  14. Greetings from Florida! I’m bored to death at work so I decided to check out your site on my
    iphone during lunch break. I enjoy the info you present here and can’t wait to take a look when I get home.

    I’m amazed at how quick your blog loaded on my
    mobile .. I’m not even using WIFI, just 3G .. Anyhow,
    wonderful blog!

  15. Oh my goodness! Incredible article dude! Thank you
    so much, However I am experiencing troubles with your RSS. I don’t understand the reason why
    I can’t subscribe to it. Is there anybody having similar RSS issues?
    Anyone that knows the solution can you kindly respond?

    Thanks!!

  16. When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment
    is added I get three e-mails with the same comment.
    Is there any way you can remove me from that service?
    Thanks a lot!

  17. I got this web site from my pal who informed me regarding this web site and
    now this time I am visiting this site and reading
    very informative posts here.

  18. Today, I went to the beachfront with my children. I found a
    sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put the
    shell to her ear and screamed. There was a hermit crab inside and it pinched her ear.
    She never wants to go back! LoL I know this is entirely off topic but I had to tell someone!

  19. I am extremely impressed with your writing skills as
    well as with the layout for your blog. Is that this a
    paid theme or did you modify it yourself? Anyway stay up the nice high quality writing, it is uncommon to see a nice weblog like this one today..

  20. İnstagram takipçi satın almak için uygun zamanı bekleme. Hemen instagram takipçi satın alma sitemize gel ve instagram takipçi sayını arttır. İnstagram takipçi sayını yükseltmek için ucuz instagram takipçi satın al ve hesabını fenomen hale getir. İnstagram’da rakiplerini takipçi sayını arttırarak geç. İnstagram takipçi yükseltmek için hemen instagram takipçi satın al.

  21. Having read this I thought it was rather informative. I appreciate you finding the time and energy to put this informative article
    together. I once again find myself personally spending way too much time both reading and leaving comments.

    But so what, it was still worthwhile!

  22. Wow that was unusual. I just wrote an incredibly long
    comment but after I clicked submit my comment didn’t show up.
    Grrrr… well I’m not writing all that over again.
    Anyway, just wanted to say superb blog!

  23. This design is steller! You certainly know how to keep a reader
    entertained. Between your wit and your videos, I
    was almost moved to start my own blog (well, almost…HaHa!) Excellent job.

    I really enjoyed what you had to say, and more than that, how you presented it.
    Too cool!

  24. İnstagram takipçi satın almak için uygun zamanı bekleme. Hemen instagram takipçi satın alma sitemize gel ve instagram takipçi sayını arttır. İnstagram takipçi sayını yükseltmek için ucuz instagram takipçi satın al ve hesabını fenomen hale getir. İnstagram’da rakiplerini takipçi sayını arttırarak geç. İnstagram takipçi yükseltmek için hemen instagram takipçi satın al.

  25. İnstagram takipçi satın alarak takipçi sayınızı arttırmak sandığınızdan çok daha kolay. Websitemizi ziyaret edin ve takipçi satın almak için paketinizi seçin. Ödeme yöntemlerinden dilediğinizi seçerek, güvenilir instagram takipçi satın alın. Hadi sende gel ve takipçi satın alarak, takipçi sayını arttır.

  26. Türk takipçi ve güvenilir takipçi satın alarak takipçinizi yükseltebilirsiniz. Sizde sosyal medya uygulamalarında daha fazla beğeni, takipçi ve izlenme için takipçi satın alabilirsiniz. Hadi gelin ve instagram takipçi satın alarak takipçi yükseltin.

  27. Güvenilir tiktok takipçi satın alma sitesi ile takipçi kazanmaya başla! 4 yıldır güvenilir ve kesintisiz Tiktok takipçi satın alma hizmeti sunan sitemiz ile sen de takipçi sayını arttırmaya başla. Ucuz ve aktif tiktok takipçi satın al servisi sunan sitemiz ile profiline organik takipçi gönder. Tiktok takipçi satın al hizmetimiz ile hesabını geliştirmek için tiktok takipçi satın alma sitemizi incele.

  28. En güvenilir takipçi hizmeti ayağınıza kadar geldi. Takipçi, beğeni, izlenme siparişiniz 5 dakika’da alınır ve hesabınıza hemen teslim edilir. Sizde tiktok takipçi satın almak için tıklayın ve ucuz takipçi satın alarak, takipçi sayınızı ikiye katlayın.

  29. Tiktok takipçi satın alma sitesi ile takipçi arttırmak artık çok kolay! Tiktok takipçi satın al paketlerimiz ile takipçi sayınızı güvenle yükseltebilirsiniz. Güvenilir ve ucuz tiktok takipçi satın al hizmetimiz ile tanışmak için sitemizi ziyaret edin. Tiktok takipçi satın al hizmetimizi denemek için güvenilir tiktok takipçi satın alma sitemizi inceleyin. En güvenilir tiktok takipçi satın alma paketleri sadece sitemizde.

  30. En güvenilir takipçi hizmeti ayağınıza kadar geldi. Takipçi, beğeni, izlenme siparişiniz 5 dakika’da alınır ve hesabınıza hemen teslim edilir. Sizde tiktok takipçi satın almak için tıklayın ve ucuz takipçi satın alarak, takipçi sayınızı ikiye katlayın.

发表评论

邮箱地址不会被公开。 必填项已用*标注