“编译php”就像让它变得便携一样

发布于 2024-09-28 00:47:48 字数 220 浏览 0 评论 0原文

我对编译性能不感兴趣,而是对能够“编译”php 脚本以便将其保存在 USB 记忆棒或便携式硬盘驱动器上感兴趣。

我认为可能有两种方式:

  1. 便携式 Apache
  2. 便携式命令行 php

我知道存在一些软件包,例如 xampp 等,以及使用 php bin 文件,但我想知道是否存在更用户友好的东西,我的意思是我只需双击,打开浏览器即可使用。

I'm not intrested in compiling for performance but in being able to "compile" a php script in order to carry it on a usb stick or portable hard drive.

I think that there may be two way:

  1. Portable Apache
  2. Portable command line php

I undersand that some package such as xampp and so on exists, as well as using the php bin files but I was wondering if something more user friendly exists, I mean something that I can just double click, open a browser and use.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

花开柳相依 2024-10-05 00:47:48

PHP 仅被解释。 XAMPP 仅设置一个带有 apache 服务器、数据库和 PHP 引擎的模拟环境。不幸的是,就能够启动 PHP 应用程序而言,XAMPP 的速度和可移植性差不多。

如果你想出一种方法来按照你想要的方式去做 - 给我发消息 - 我会付钱......

PHP is only interpreted. XAMPP merely sets up a mock environment with an apache server, a database, and the PHP engine. Unfortunately, XAMPP is about as fast and portable you're going to get in terms of being able to fire up a PHP app.

If you figure out a way to do it the way you're looking to - message me - I'll pay for it...

翻了热茶 2024-10-05 00:47:48

搜索网络给我这个

和这个

我发现了两个本机 PHP 编译器。

searching the web gives me this

and this

Two native PHP compiler i found.

心碎的声音 2024-10-05 00:47:48

PHP 5.4+ 有一个内置的网络服务器...我能够简单地将我的 php 可执行文件复制到随机文件夹中并且...

# ~/someDir/php -S localhost:7676 -t ~/docRoot ENTER

PHP 5.4.0RC3 Development Server started at Tue Jan  3 15:57:33 2012
Listening on localhost:7676
Document root is /Users/localadmin/docRoot
Press Ctrl-C to quit.`

浏览到 http://localhost:7676 就可以了。

如果您想要更多的可移植性,您可以使用构建命令(例如 ./configure --enable-static --disable-shared --disable-all)深入研究重新编译 PHP 的世界

PHP 5.4+ has a built-in webserver... I was able to simple copy my php executable into a random folder and...

# ~/someDir/php -S localhost:7676 -t ~/docRoot ENTER

PHP 5.4.0RC3 Development Server started at Tue Jan  3 15:57:33 2012
Listening on localhost:7676
Document root is /Users/localadmin/docRoot
Press Ctrl-C to quit.`

Browse to http://localhost:7676 and you're good to go.

If you want even more portability, you can delve into the world of recompiling PHP with a build command such as ./configure --enable-static --disable-shared --disable-all

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文