久久久久久久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 | 黄频在线观看 | www..com黄| 蜜桃视频成人 | 国产三级在线免费观看 | 欧美精品久久久久久 | 最新国产在线视频 | 久久精品一二三 | 在线观看黄色片 | 中文字幕久久久 | 国产欧美日韩一区 | 中文字幕在线看片 | 伊人操 | 欧美日韩在线不卡 | 国产在线色 | 国产又色又爽又黄又免费 | 三级视频在线播放 | 久久国产欧美 | 久草视频在线播放 | 日韩黄色免费视频 | 日韩精品免费在线观看 | 中文字幕视频 | 欧美日韩中文字幕 | 亚洲精品字幕在线观看 | 欧洲精品一区 | 国产精品手机在线 | 日本三级大片 | 亚洲欧美高清 | 久久精品一区二区国产 | 三级在线免费观看 | 视频一区二区在线播放 | 色综合激情 | 亚洲资源网| 久久靖品 | 久艹在线观看 | 国产精品麻豆免费版 | 成人免费在线观看网站 | 国产精品网站在线观看 | 五月婷婷视频 | 亚洲精品小视频 |