简体   繁体   English

如何通过一键运行/安装来捆绑 php 应用程序

[英]How to bundle a php application with 1 click run/install

I create php application for small businesses.我为小型企业创建 php 应用程序。 Some of the clients may prefer running the app on a local server, therefore my requirement is to create/bundle an app with apache/mysql/php with all the necessary confirguration and one click executable (be it a batch file) such that when the user opens it, it runs the apache server on some port say localhost:1234 and mysql as well.一些客户可能更喜欢在本地服务器上运行应用程序,因此我的要求是使用 apache/mysql/php 创建/捆绑一个应用程序,其中包含所有必要的配置和一键可执行文件(可以是批处理文件),这样当用户打开它,它在某个端口上运行 apache 服务器,比如 localhost:1234 和 mysql。

and opens up the application in the default web browser.并在默认 Web 浏览器中打开应用程序。

To be more exact, Im looking for something like http://www.simpleinvoices.org/go , check their Simple Invoices for Windows which come budled with apache/php/mysql.更准确地说,我正在寻找类似http://www.simpleinvoices.org/go 的东西,检查他们的 Windows 简单发票,其中包含 apache/php/mysql。

PS - Im not sure if this question should be at SO or Superuser. PS - 我不确定这个问题应该在 SO 还是超级用户。

I had the same challenge and came across Uniform Server:我遇到了同样的挑战并遇到了 Uniform Server:

http://www.uniformserver.com/ http://www.uniformserver.com/

You download it, add your application to it, start it and everything runs.您下载它,将您的应用程序添加到其中,启动它,一切都会运行。 Lovely.迷人的。

If you actually want to install a web server and a SQL server then Lars' solution would be a way to go.如果您确实想安装 Web 服务器和 SQL 服务器,那么 Lars 的解决方案将是一种可行的方法。 On windows you can generate a .msi installer containing the dependencies you need (like WAMP).在 Windows 上,您可以生成一个 .msi 安装程序,其中包含您需要的依赖项(如 WAMP)。 An installer executable would be a cleaner solution than a batch file in my opinion, as it will also provide the user with an option to uninstall your software if they wish.在我看来,安装程序可执行文件是比批处理文件更简洁的解决方案,因为如果用户愿意,它还会为用户提供卸载软件的选项。

If you want to distribute your application in a standalone version, then you might also want to check a solution like NuSphere's PHPDock - http://www.nusphere.com/products/phpdock.htm如果您想以独立版本分发您的应用程序,那么您可能还想查看 NuSphere 的 PHPDock 之类的解决方案 - http://www.nusphere.com/products/phpdock.htm

PHP Desktop is the best option I found when researching this. PHP Desktop 是我在研究这个时发现的最佳选择。

https://github.com/cztomczak/phpdesktop https://github.com/cztomczak/phpdesktop

PHP Nightrain is also an option: PHP Nightrain 也是一种选择:

https://download.cnet.com/PHP-Nightrain/3000-10248_4-76169308.html https://download.cnet.com/PHP-Nightrain/3000-10248_4-76169308.html

Bitnami WAMP stack looks good as well: Bitnami WAMP 堆栈看起来也不错:

https://docs.bitnami.com/installer/infrastructure/wamp/ https://docs.bitnami.com/installer/infrastructure/wamp/

Superuser would have been better.超级用户会更好。 But depending on your requirements, you should just create a package to install.但是根据您的要求,您应该只创建一个要安装的包。 On windows, package it with WAMP, on linux, package it with either one-click-install or creating packages for the two biggest systems, namely APT and RPM.在 windows 上,用 WAMP 打包,在 linux 上,通过一键安装或为两个最大的系统(即 APT 和 RPM)创建包来打包。 With the dependency-system on all of them you can make sure, that your application runs right off the bat.使用所有这些依赖项系统,您可以确保您的应用程序立即运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM