如何在客户端系统上不安装 xampp 的情况下运行 php 应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19049732/
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
How to run an php application without installing xampp on client system?
提问by Pavan Kumar
In my application i have to deploy my application on client system. So is there any way to run my php application without installing xampp...
在我的应用程序中,我必须在客户端系统上部署我的应用程序。那么有什么方法可以在不安装 xampp 的情况下运行我的 php 应用程序...
Because the client should access it as a readymade app without installing anything...
因为客户端应该将它作为现成的应用程序访问,而无需安装任何东西......
This is the description of my project...
这是我的项目的描述...
We have to develop an application where the client will have our application he will connect to remote server
我们必须开发一个应用程序,客户端将拥有我们的应用程序,他将连接到远程服务器
Then he will download the data from remote server...
然后他会从远程服务器下载数据...
Then he uses that downloaded data using that app
然后他使用该应用程序使用下载的数据
Here my requirement is the user may not have the knowledge of installing the xampp...
这里我的要求是用户可能不具备安装 xampp 的知识...
So is there any way to run the application in user system just by copying some files
那么有什么方法可以通过复制一些文件在用户系统中运行应用程序
U may suggest me a one click solution (like using installer which will include installation of xampp and copying my data into user system)
您可能会建议我使用一键式解决方案(例如使用安装程序,其中包括安装 xampp 并将我的数据复制到用户系统中)
采纳答案by ideonexus
I'm a big fan of server2go. I've used it to deploy PHP applications on CD/DVD. It comes with MySQL and is relatively easy to configure. I've even replaced their splash screen with my own so no one knows I'm using it. It's donationware, but I was impressed enough to donate:
我是 server2go 的忠实粉丝。我用它在 CD/DVD 上部署 PHP 应用程序。它与 MySQL 一起提供,并且相对容易配置。我什至用我自己的替换了他们的启动画面,所以没有人知道我在使用它。这是捐赠软件,但我对捐赠印象深刻:
With this application, you don't have to install all that other stuff. It's self-contained in this executable and directory.
使用此应用程序,您不必安装所有其他东西。它自包含在这个可执行文件和目录中。
EDIT: To clarify, server2go does not install anything on the client machine. It runs as an exe only when you specifically want it to. When you click on the .exe file, it launches your PHP application in a browser window, then you can right-click on the server2go icon in the system tray and close it when you're done.
编辑:澄清一下,server2go 不会在客户端机器上安装任何东西。它仅在您特别需要时才作为 exe 运行。当您单击 .exe 文件时,它会在浏览器窗口中启动您的 PHP 应用程序,然后您可以右键单击系统托盘中的 server2go 图标并在完成后关闭它。
EDIT2: One gotcha: if you want to save data to the MySQL db on the client machine, you'll need to copy serve2go to a directory on the client machine or run it on a writable USB stick. If you run this application off CD/DVD, it will be able to read data from the database, but not write.
EDIT2:一个问题:如果你想将数据保存到客户端机器上的 MySQL 数据库,你需要将 serve2go 复制到客户端机器上的目录或在可写 U 盘上运行它。如果您在 CD/DVD 上运行此应用程序,它将能够从数据库读取数据,但不能写入。
回答by MUHSIN MOHAMED PC
The better way is to use PHP Desktop Application. It will allow you to run your PHP Script like a Desktop application and you don't need to install Xampp or any other web server to run.
更好的方法是使用 PHP 桌面应用程序。它将允许您像桌面应用程序一样运行 PHP 脚本,并且无需安装 Xampp 或任何其他 Web 服务器即可运行。
After downloading the .Zip file unzips it to any folder that you like. After unzipping, Go to the folder, and there you can see a folder "www". Delete all the files contained in it and move all your php script to it.
下载 .Zip 文件后,将其解压缩到您喜欢的任何文件夹。解压后,进入文件夹,可以看到一个文件夹“ www”。删除其中包含的所有文件并将所有 php 脚本移动到其中。
Once you moved all your files into it. Run the .Exe file named "PHP desktop-chrome"
一旦您将所有文件都移入其中。运行名为“ PHP desktop-chrome”的 .Exe 文件
It will open your PHP Script really like a Desktop Application.
它将像桌面应用程序一样打开您的 PHP 脚本。
This script doesn't require any kind of server software like Xampp, Wamp, Etc installed in your PC.
此脚本不需要在您的 PC 中安装任何类型的服务器软件,如 Xampp、Wamp 等。
回答by Puppuli
You can either host the php application or install the application into one system as server and call in client system using the ip of the server system like the following
您可以托管 php 应用程序,也可以将应用程序安装到一个系统中作为服务器,然后使用服务器系统的 ip 调用客户端系统,如下所示
http://**ip address/php file name
回答by Rishav
I really dont want to use any external software to open PHP pages so I did some digging and found that if you run php -S localhost:port
in your working directory you basically start a server there.
我真的不想使用任何外部软件来打开 PHP 页面,所以我做了一些挖掘,发现如果你php -S localhost:port
在你的工作目录中运行,你基本上会在那里启动一个服务器。
S
is a capital S and not s
S
是大写的 S 而不是 s
回答by Basti Funck
PHP Application are not meant to be deployed on multiple clients. It's meant to be deployed on a webserver (your own server with sth. like IIS or XAMPP) so the clients can access it via their browser and doesn't have to install anything more.
PHP 应用程序不打算部署在多个客户端上。它旨在部署在网络服务器上(您自己的服务器,例如 IIS 或 XAMPP),因此客户端可以通过浏览器访问它,而无需再安装任何东西。
If you want to deploy applications on the client pc's i recommened an other programming language like Java or C/C++.
如果您想在客户端 pc 上部署应用程序,我建议使用其他编程语言,如 Java 或 C/C++。
回答by Pavan Kumar
I simply used xampp zip version so i copied my application into htdocs and the whole xampp is given to the customer so he simply running the application eazily without installation.
我只是使用了 xampp zip 版本,所以我将我的应用程序复制到 htdocs 中,并将整个 xampp 提供给客户,因此他无需安装即可轻松运行应用程序。
回答by Gaurab Pradhan
If you don't want your client to install anything then you should create Client Server architecture, there is no another way.
如果您不想让您的客户端安装任何东西,那么您应该创建客户端服务器架构,没有其他方法。
回答by gazdac
No, you need some kind of server - Wamp, Xampp, etc.
不,您需要某种服务器 - Wamp、Xampp 等。
You can host it online, and then he can just browse it from his PC.
您可以在线托管它,然后他就可以从他的 PC 上浏览它。