自做Windows上介面美觀的PHP整合環境軟體

2021-07-27 09:49:10 字數 3967 閱讀 9578

windows上wnmp整合環境

介面展示一下:

原始碼:salamanderwnmp

平常工作中用nginx比較多,網上雖然也有wnmp整合環境,但是感覺介面不好看,用起來不舒服,所有決定自己做乙個吧。

public class wnmpprogram: inotifypropertychanged

// label that shows the programs status

public string exename // location of the executable file

public string procname // name of the process

public string progname // user-friendly name of the program

public string workingdir // working directory

public log.logsection proglogsection // logsection of the program

public string startargs // start arguments

public string stopargs // stop arguments if killstop is false

public bool killstop // kill process instead of stopping it gracefully

public string confdir // directory where all the programs configuration files are

public string logdir // directory where all the programs log files are

public ini settings

//public contextmenustrip configcontextmenu // displays all the programs config files in |confdir|

//public contextmenustrip logcontextmenu // displays all the programs log files in |logdir|

public process ps = new process();

public event propertychangedeventhandler propertychanged;

// 是否在執行

private bool running = false;

public bool running

set}

}public wnmpprogram()

/// /// 設定狀態

///

public void setstatus()

else

}public void startprocess(string exe, string args, bool wait = false)

}public virtual void start()

try catch (exception ex)

}public virtual void stop()

if (killstop == false)

startprocess(exename, stopargs, true);

var processes = process.getprocessesbyname(procname);

foreach (var process in processes)

log.wnmp_log_notice("stopped " + progname, proglogsection);

}public void restart()

//public void configbutton(object sender)

////private void logcontextmenu_itemclicked(object sender, toolstripitemclickedeventargs e)

// catch (exception ex)

//}public bool isrunning()

}

class mysqlprogram : wnmpprogram

public void removeservice()

public void installservice()

public bool serviceexists()

return false;

}public override void start()

try catch (exception ex)

}public override void stop()

try catch (exception ex) }}

class phpprogram : wnmpprogram

private string getphpinipath()

public override void start()

uint processcount = settings.php_processes.value;

short port = settings.php_port.value;

string phpini = getphpinipath();

try -c ", port, phpini));

log.wnmp_log_notice("starting php " + i + "/" + processcount + " on port: " + port, proglogsection);

port++;

}log.wnmp_log_notice("php started", proglogsection);

} catch (exception ex) }}

#這裡要注意workingdirectory屬性設定成nginx目錄,這裡是setup**
private readonly wnmpprogram nginx = new wnmpprogram();

private void setupnginx()

/nginx.exe", settings.nginxdirname.value);

nginx.procname = "nginx";

nginx.progname = "nginx";

nginx.workingdir = startuppath + settings.nginxdirname.value;

nginx.proglogsection = log.logsection.wnmp_nginx;

nginx.startargs = "";

nginx.stopargs = "-s stop";

nginx.killstop = false;

nginx.statuslabel = lblnginx;

nginx.confdir = "/conf/";

nginx.logdir = "/logs/";

}

配置nginx,php,mysql目錄名,管理php擴充套件

程式語言面板

其實使用者完全可以選擇自己想要的php版本,放到整合環境的目錄下即可(改一下配置,重啟)

修改php.ini中的extension_dir配置,改為php目錄下ext目錄的絕對路徑

修改conf目錄下nginx.conf中的localhost虛擬主機的root(**根目錄),改為某個目錄(譬如d:/web_root)的絕對路徑(使用/,使用\會出錯)

修改my.ini檔案中base_dir和data_dir的配置,分別修改為mysql目錄和mysql目錄下的data目錄的絕對路徑

tryton,功能齊全介面美觀的小微企業開源erp

tryton,功能齊全介面美觀的小微企業開源erp erpnext針對中小型企業,國外對中小型企業的定義是年產值在1千萬美元到5千萬美元之間,對於年產值在1千萬美元以下的小微企業來說,erpnext的功能過於細緻,流程控制也太嚴格,小微企業需要的是簡單點的財務進銷存和生產管理系統,tryton就是德...

自寫Windows服務的安裝步驟

自寫windows服務的安裝步驟 程式概覽 最近有乙個將redis儲存的資料定期寫入資料庫的需求,經過查詢資料,決定寫乙個windows service,使用定時器定期對redis資料庫進行鍵值遍歷,並將每乙個hash值作為資料庫表的乙個記錄,存入資料庫表中。這樣可以不用每次使用某個模組都會去訪問資...

做專案時,如何做比較美觀大方的資料輸入窗體

從畢業開始到現在,這幾年做的專案,大部分時間是在做資料輸入窗體,做過一年的報表,完全不和ui打交道。那時候以為做ui很容易。做ui確實是很容易,控制項拖拉一下,但是要做的專業一點,還是要花點功夫,看起來很容易的事情,不太容易做好。先看乙個經典的asp後台程式 做過asp程式的朋友,相信看到這個介面,...