久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何使用 PHP 啟動 Windows GUI 程序?

How can I start a Windows GUI program using PHP?(如何使用 PHP 啟動 Windows GUI 程序?)
本文介紹了如何使用 PHP 啟動 Windows GUI 程序?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

可能的重復:
php 我該怎么做啟動一個外部程序運行 - 系統和執行有問題

如何用php打開exe?
我有這個想法并努力成功了好幾年,但最終失敗了.有人告訴我完成這項工作的成功方法嗎?

how to open exe with php?
I had this idea and make hard to success it for several years,but failed at last. any one tell me a success method to do the job ?

<?php 
    if(isset($_POST['file_path'])){
        /* ------- 
            using "notepad++.exe" to open "test.php" file.
            or run a bat file which calling "notepad++.exe" to open "test.php" file.
            how to seting php.ini or firefox or any setting to do this job. 
            it is only for conveniently developing web page in my PC ,not for web servers
        ------- */
    }
?>

<form action="test.php" method="post">
    <input type="text" name="file_path" value="test.php"/>
    <button type="submit">open with notepad++</button>
</form>

這將創建類似:

推薦答案

在運行網絡服務器的計算機上啟動一個程序:

To launch a program on the computer which runs the webserver:

<?php
exec('"C:Program Files (x86)Notepad++
otepad++.exe" "C:foo.php"');

如果網絡服務器不作為 Windows 服務運行,上述內容將適用于 vista/win7.例如,如果您運行 apache 并且它會在您的計算機啟動時自動啟動,那么您可能將它安裝為一項服務.您可以檢查 apache 是否出現在 windows 服務選項卡/thingy 中.

The above will work on vista/win7 IF the webserver does not run as a windows service. For example, if you run apache and it automatically starts when your computer boots, you probably installed it as a service. You can check to see if apache shows up in the windows services tab/thingy.

如果網絡服務器作為服務運行,您需要考慮為該服務啟用允許桌面交互"選項.但除此之外:

If the webserver runs as a service, you'll need to look into enabling the "allow desktop interaction" option for the service. But otherwise:

使用 php 的新內置網絡服務器(php 5.4+)的簡單測試.這里的關鍵是您從 shell 手動啟動服務器,因此它作為您的用戶而不是作為服務運行.

An easy test using php's new built in webserver(php 5.4+). The key thing here is you manually start the server from a shell, so it runs as your user instead of as a service.

<?php
// C:myhtdocsscript.php
exec('"C:Program Files (x86)Notepad++
otepad++.exe" "C:foo.php"');

通過命令窗口啟動網絡服務器

start a webserver via a command window

C:path	ophp.exe -S localhost:8000 -t C:myhtdocs

然后在您的瀏覽器中http://localhost:8000/script.php

這篇關于如何使用 PHP 啟動 Windows GUI 程序?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 亚洲精品自拍视频 | 中文字幕亚洲一区 | 亚洲免费在线视频 | 亚洲午夜精品视频 | 欧美激情一区二区三级高清视频 | 91资源在线播放 | 免费成人在线网 | 99精品99 | 中文字幕一区二区三区精彩视频 | 毛片免费看 | 综合久久一区 | 久久大 | 国产欧美精品区一区二区三区 | 国产精品一区二区视频 | 祝你幸福电影在线观看 | 亚洲狠狠| 国产成人91视频 | 一区二区三区在线免费观看视频 | 久久午夜剧场 | 电影午夜精品一区二区三区 | 色在线免费 | 国产91在线观看 | 三级在线视频 | 欧美精品在线免费 | 日韩综合在线 | 亚洲国产成人精品女人久久久 | 国产精品亚洲一区二区三区在线 | 国产在线精品一区二区三区 | 精品自拍视频在线观看 | 一区二区中文字幕 | 中文字幕一区二区三区四区五区 | 91综合网| 国产乱码一二三区精品 | 国产精品区二区三区日本 | 国产探花在线精品一区二区 | 中文字幕av网址 | 91影片| 日韩高清国产一区在线 | 中文字幕不卡一区 | 在线视频91 | 精品一区国产 |