国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

使用FileMonitor時報錯

Kevin_

項目結(jié)構(gòu)

報錯信息

PHP Fatal error:  Cannot redeclare check_files_change() (previously declared in /www/wwwroot/learnOperGateWayWorker/GatewayWorker/Applications/FileMonitor/start.php:26) in /www/wwwroot/learnOperGateWayWorker/GatewayWorker/Applications/YourApp/start.php on line 49

Fatal error: Cannot redeclare check_files_change() (previously declared in /www/wwwroot/learnOperGateWayWorker/GatewayWorker/Applications/FileMonitor/start.php:26) in /www/wwwroot/learnOperGateWayWorker/GatewayWorker/Applications/YourApp/start.php on line 49

過程復(fù)現(xiàn)

  1. 在GatewayWorker目錄下運行“php start.php start”,就會報上面的錯誤
2152 3 0
3個回答

phpcreeper

看上去是/path/to/YourApp/start.php腳本中重定義了funciton check_file_changes(), 這個函數(shù)在FileMonitor包中已經(jīng)定義過了,不清楚你要干啥,換個函數(shù)名就行了。

  • Kevin_ 2021-12-18

    我想實現(xiàn)熱更新,check_files_change這個方法只在FileMonitor/start.php中定義了一次,按照“https://github.com/walkor/workerman-filemonitor”做的,代碼是從這個地址下載下來的,無改動

  • phpcreeper 2021-12-18

    說的是/path/to/YourApp/start.php腳本沒有改動過?

  • Kevin_ 2021-12-18

    YourApp目錄下沒有start.php,只有start_businessworker.php、start_gateway.php、start_register.php,這三個文件只改了start_gateway.php文件里的協(xié)議,報錯的不是YouApp下的文件,報錯的是FileMonitor下的start.php

  • phpcreeper 2021-12-18

    GatewayWorker下的start.php

  • Kevin_ 2021-12-18

    不是GatewayWorker下的start.php,是GatewayWorker\Applications\FileMonitor\start.php,這個是workerman的一個文件監(jiān)控組件,報錯的就是這個組件

  • phpcreeper 2021-12-18

    一開始說了函數(shù)check_file_changes()本來就在官方FileMonitor文件監(jiān)控包里呢,不是什么包報錯,而是有其他的腳本里有重定義的同名函數(shù),這是本質(zhì),具體是哪個腳本里自己排查下就完事了啊,別整復(fù)雜了。

  • Kevin_ 2021-12-18

    我寫的所有腳本里都沒有check_files_change這個函數(shù),這個只在官方的文件監(jiān)控包里有,我搜索了整個項目,也顯示只在官方的文件監(jiān)控包里有

  • Kevin_ 2021-12-18

    謝謝前輩的熱心回答,我找到問題了
    問題確如報錯所示,是函數(shù)沖突問題,并給出了兩個文件的位置
    但是我的“Applications/YourApp/”目錄下沒有start.php文件,所以迷茫了。原因是我在本地使用phpstorm寫代碼自動同步到服務(wù)器,之前在YourApp下創(chuàng)建了一個start.php,后來把文件移走了,但是這項修改沒有被同步到服務(wù)器端,導(dǎo)致了上面的報錯,而我排查的時候是根據(jù)本地的文件進行排查的,最后檢查了服務(wù)器上面的文件,已經(jīng)解決了問題,官方的FileMonitor組件非常好用,再次感謝blogdaren前輩的回答

xiuwang
PHP Fatal error:  Cannot redeclare check_files_change() (previously declared in /www/wwwroot/learnOperGateWayWorker/GatewayWorker/Applications/FileMonitor/start.php:26) in /www/wwwroot/learnOperGateWayWorker/GatewayWorker/Applications/YourApp/start.php on line 49

翻譯過來就是不能在YourApp/start.php文件的第49行重新定義 check_files_change() (因為check_files_change()在FileMonitor/start.php第26行定義過)。報錯文件、行數(shù)、重復(fù)的函數(shù)名都提示給你了,應(yīng)該很好找了

  • Kevin_ 2021-12-18

    26行是定義的函數(shù),49行是一個括號結(jié)尾,代碼是官方的,地址:https://github.com/walkor/workerman-filemonitor/blob/master/Applications/FileMonitor/start.php

  • xiuwang 2021-12-18

    請貼出你本地這兩個文件內(nèi)容

  • xiuwang 2021-12-18

    Applications/FileMonitor/start.php 和 Applications/YourApp/start.php

  • Kevin_ 2021-12-18

    謝謝前輩的熱心回答,我找到問題了
    問題確如報錯所示,是函數(shù)沖突問題,并給出了兩個文件的位置
    但是我的“Applications/YourApp/”目錄下沒有start.php文件,所以迷茫了。原因是我在本地使用phpstorm寫代碼自動同步到服務(wù)器,之前在YourApp下創(chuàng)建了一個start.php,后來把文件移走了,但是這項修改沒有被同步到服務(wù)器端,導(dǎo)致了上面的報錯,而我排查的時候是根據(jù)本地的文件進行排查的,最后檢查了服務(wù)器上面的文件,已經(jīng)解決了問題,官方的FileMonitor組件非常好用,再次感謝xiuwang前輩的回答

Tinywan

默認debug模式就是自動會更新的,為什么還要這樣子搞

  • Kevin_ 2021-12-19

    debug模式會自動熱更新嗎?

年代過于久遠,無法發(fā)表回答
??