久久久久久久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)
主站蜘蛛池模板: 国产精品中文字幕在线 | 国产精品久久av | 亚洲小视频在线播放 | 伊人一二三 | 免费观看成人鲁鲁鲁鲁鲁视频 | 日本三级网址 | 亚洲精精品 | 欧美婷婷| 午夜精品久久久久久久久久久久久 | 成人av一区 | 欧美另类视频在线 | 无码日韩精品一区二区免费 | 久久国产亚洲精品 | 成人在线免费观看 | 亚洲一区 中文字幕 | 亚洲视频在线观看免费 | 成人免费毛片片v | 91视在线国内在线播放酒店 | 一区二区三区四区免费视频 | 成人国产精品久久 | 欧美日韩在线不卡 | 亚洲在线免费观看 | 自拍偷拍中文字幕 | 天天干天天爱天天操 | 男人影音| 亚洲a一区二区 | 亚洲视频观看 | 国产真实精品久久二三区 | 成人一区在线观看 | 久久久久久久国产精品影院 | 午夜精品久久久久久久久久久久久 | 久久久激情 | av天天看| 91精品国产综合久久福利软件 | 久久综合久久久 | 日韩一级电影免费观看 | 欧美一级欧美三级在线观看 | 国产这里只有精品 | 日韩中文在线观看 | 综合久久综合久久 | 久久久久久国产精品免费免费狐狸 |