php 使用mysql数据库在php中创建.exe文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9460877/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Create .exe file in php with mysql database
提问by skr07
i have developed in-house software for hotel management system using PHP/MYSQL. Our Client wants Software in .exe format and used in desktop. i use various softwares for .exe conversion but it only support php but i want's to connect with MySQL Database. Please anyone can help to create .exe conversion with MySQL Database..
我已经使用 PHP/MYSQL 为酒店管理系统开发了内部软件。我们的客户需要 .exe 格式的软件并在桌面上使用。我使用各种软件进行 .exe 转换,但它只支持 php,但我想连接 MySQL 数据库。请任何人都可以帮助使用 MySQL 数据库创建 .exe 转换..
回答by softwarebala
Download PHP Desktop Chrome.
Copy all your code from site directory to
Phpdesktopchrome/www
directory.Run Phpdesktopchrome.exe, it will execute like a browser with PHP compiler.
Download Innosetup Softwarefor make exe file.
Install and run Innosetup and select Phpdesktop chrome files to create a EXE file in Option.
Install wampserver in client system with database import.
Enjoy.
将所有代码从站点目录复制到
Phpdesktopchrome/www
目录。运行 Phpdesktopchrome.exe,它将像带有 PHP 编译器的浏览器一样执行。
下载Innosetup 软件制作 exe 文件。
安装并运行 Innosetup 并选择 Phpdesktop chrome files 以在 Option 中创建一个 EXE 文件。
使用数据库导入在客户端系统中安装 wampserver。
享受。
回答by Girdhari Lal Kumawat
There are many compliers available on web by which you can create EXE in PHP. This program runs through dos and windows only... :) so this is good news for windows user
网络上有许多编译器,您可以通过它们在 PHP 中创建 EXE。该程序仅通过 dos 和 windows 运行... :) 所以这对 windows 用户来说是个好消息
- First Download zip from Here.
- Now unzip it and open Command prompt and then go to its directory location.
- Start -> run then type ‘cmd'
- Use the “cd..” command to change directory.
- Place PHP script to be compiled next to bamcompile.exe place it in same directory.
In the cmd prompt, at that directory, type:
bamcompile test.php
- 首先从这里下载 zip 。
- 现在解压缩它并打开命令提示符,然后转到其目录位置。
- 开始->运行然后输入'cmd'
- 使用“cd..”命令来改变目录。
- 将要编译的 PHP 脚本放在 bamcompile.exe 旁边,放在同一目录中。
在 cmd 提示符下,在该目录中,键入:
bamcompile test.php
variations:
变化:
bamcompile -c test.php gives compression.
-e:something.dll allows a DLL to be embedded
Ready made examples are given in Zipped files which you have downloaded,just try it out. Another application wapache is also there but i dont know much about it.
您下载的压缩文件中给出了现成的示例,请尝试一下。另一个应用程序 wapache 也在那里,但我不太了解它。
回答by Krishna Torque
DOWNLOAD WAMP server from wampserver.com. its very good for offline use server for desktop, then just copy and paste you script abd .sql file into it. and you are Done.
从 wampserver.com 下载 WAMP 服务器。它非常适合用于桌面的离线使用服务器,然后只需将脚本 abd .sql 文件复制并粘贴到其中即可。你就完成了。
If your client using highspeed interenet then they can connect the server to online. but they need super computer for more traffic, another option is LAN.
如果您的客户端使用高速互联网,那么他们可以将服务器连接到在线。但是他们需要超级计算机来获得更多流量,另一个选择是局域网。
If the program is for office use and no need to connect a lot of computer and internet then use LAN and WAMP.
如果该程序用于办公,不需要连接大量计算机和互联网,则使用 LAN 和 WAMP。
------ Another possible you can use --------
------ 你可以使用的另一种可能------
Install WAMP then copy then .exe file "click start button > all program > and paste into startup folder". server will run automatic windows OS start or restart but it take 2-3 min. (green light)
go to wamp folder > www > make a folder for your program then paste your script.
open any browser then in address bar type "localhost or 127.0.0.1 (localhost IP for offline)" , scroll down and you will see "Your Projects" and under of this you will see your folder which you had create into wamp server > www folder. click on it and here you gooooo....
Now your client can do work with your script. Bookmark it and also create a shortcut into desktop for direct use.
安装 WAMP,然后复制 .exe 文件“单击开始按钮 > 所有程序 > 并粘贴到启动文件夹中”。服务器将运行自动 Windows 操作系统启动或重新启动,但需要 2-3 分钟。(绿灯)
转到 wamp 文件夹 > www > 为您的程序创建一个文件夹,然后粘贴您的脚本。
打开任何浏览器,然后在地址栏中键入“localhost or 127.0.0.1 (localhost IP for offline)”,向下滚动,您将看到“您的项目”,在此之下您将看到您在 wamp 服务器中创建的文件夹 > www文件夹。点击它,在这里你gooooo....
现在您的客户可以使用您的脚本。为它添加书签,并在桌面上创建一个快捷方式以直接使用。
Hope this may help you. thank you.
希望这可以帮助你。谢谢你。
If you are getting any problem to do this work, then email me here - ([email protected])
如果您在完成这项工作时遇到任何问题,请在此处给我发电子邮件 - ([email protected])
回答by roosevelt
For a desktop application I recommend that you change your database settings (if you can) and switch to SQLite3 DB. They are portable files and does not need a database server to run.
对于桌面应用程序,我建议您更改数据库设置(如果可以)并切换到 SQLite3 DB。它们是可移植文件,不需要数据库服务器即可运行。
回答by Kalpesh B.
We need to bundle your project files in MSI ( windows installer ) along with PHP frameworks, MySQL and Apache.
我们需要将您的项目文件与 PHP 框架、MySQL 和 Apache 捆绑在 MSI(Windows 安装程序)中。
Everything can be included in a single MSI file or you can keep server part in one MSI (PHP framework+Apache framework+ MySQL) and your Project file along with Yiiframework in another MSI.
一切都可以包含在一个 MSI 文件中,或者您可以将服务器部分保留在一个 MSI(PHP 框架 + Apache 框架 + MySQL)中,并将您的项目文件与另一个 MSI 中的 Yiiframework 一起保留。
I already made server part MSI in order to create one of my previous web project. In that project i had to configure Mysql DB (my.ini) and Apache configuration file (.conf). It worked fine.
我已经制作了服务器部分 MSI 以创建我以前的 Web 项目之一。在那个项目中,我必须配置 Mysql DB (my.ini) 和 Apache 配置文件 (.conf)。它工作得很好。
回答by craigmj
I think you should just convince your client not to use a .exe installer. It makes no sense.
我认为您应该说服您的客户不要使用 .exe 安装程序。这没有道理。
You could have an installer that installs a local webserver and a local MySQL, and then opens a web browser and browses the local webserver. This would work, but it means your application runs on only one machine, and can't be used by two people.
您可以使用安装程序安装本地网络服务器和本地 MySQL,然后打开网络浏览器并浏览本地网络服务器。这会起作用,但这意味着您的应用程序只能在一台机器上运行,并且不能被两个人使用。
On the other hand, you could install an application that talks to a central MySQL database, hosted on the LAN. But then why not install the entire application (webserver, MySQL etc) on the LAN, and have the clients access it across the LAN as a web application? Still no reason for a local install.
另一方面,您可以安装一个与位于 LAN 上的中央 MySQL 数据库对话的应用程序。但是,为什么不在 LAN 上安装整个应用程序(Web 服务器、MySQL 等),并让客户端作为 Web 应用程序通过 LAN 访问它呢?仍然没有理由进行本地安装。
I would suggest:
我会建议:
- See if you can persuade your client to move to an entirely web-hosted solution. Emphasize how easy updates are - from one central location, not from each machine; or
- See if you client won't be happy with a .exe that installs a link to a URL (on the LAN).
- 看看您是否可以说服您的客户转向完全由网络托管的解决方案。强调更新是多么容易——从一个中心位置,而不是从每台机器;或者
- 看看您的客户是否对安装指向 URL(在 LAN 上)的链接的 .exe 不满意。
回答by Bert
VERY SHORT ANSWER: NOT POSSIBLE
非常简短的回答:不可能
Tell your client that it is a client-server application not a desktop app.
告诉您的客户它是一个客户端-服务器应用程序,而不是一个桌面应用程序。
One idea is to have portable PHP/MYSQL/APACHE that can be stored in a CD or used and create an autorun fro it..
一个想法是拥有可移植的 PHP/MYSQL/APACHE,可以存储在 CD 中或使用它并从中创建自动运行。
回答by alfasin
Tell your client you can do better than that, you can create a batch file for his use!
告诉您的客户您可以做得更好,您可以创建一个批处理文件供他使用!
Then create a program.bat file with one line that runs the php (should be something like "php ").
然后创建一个 program.bat 文件,其中一行运行 php(应该类似于“php”)。
:)
:)
回答by Razvan Traian
Use http://www.usbwebserver.com/and from a stick or an CD/DVD you will be able to run your application. It is a portable version similar to W
使用http://www.usbwebserver.com/并从记忆棒或 CD/DVD 中运行您的应用程序。它是类似于W的便携式版本