离线使用 PHP

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6269467/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 23:50:54  来源:igfitidea点击:

Working with PHP offline

phpoffline

提问by Michael

Is there a tool or extension for a browser to working with PHP offline? I read about you need to install an Apache server.

是否有浏览器可以离线使用 PHP 的工具或扩展?我读到您需要安装 Apache 服务器。

Is there an easier way to view offline in browser to see how the PHP code executes?

有没有更简单的方法可以在浏览器中离线查看以查看 PHP 代码的执行方式?

采纳答案by Naftali aka Neal

In Windows, install XAMPPor WAMP
Which are Windows Apache Mysql and Php bundles

在 Windows 中,安装XAMPPWAMP,
它们是 Windows Apache Mysql 和 Php 包

In Linux install LAMP
Which is a Linux Apache Mysql and Php bundle

在 Linux 中安装LAMP
这是一个 Linux Apache Mysql 和 PHP 包

Both of which could help

两者都可以帮助

回答by ceejayoz

XAMPPsets up a local install of MySQL, PHP, and Apache that you can develop on.

XAMPP设置本地安装的 MySQL、PHP 和 Apache,您可以在其上进行开发。

回答by vindia

Nope, simpler than xamppis not possible.

不,不可能比xampp更简单。

回答by salathe

This won't be much use to you now, but there has been recent talk (and submission of code) of providing a built-in web server into PHP itself.

这对您现在没有多大用处,但最近有关于在 PHP 本身中提供内置 Web 服务器的讨论(和提交代码)。

See the RFC at https://wiki.php.net/rfc/builtinwebserver

请参阅https://wiki.php.net/rfc/builtinwebserver 上的 RFC

You could then write your script (e.g. app.php), execute php -S localhost:8000to start the web server and then see the results in your browser at http://localhost:8000/app.php.

然后,您可以编写脚本(例如app.php),执行php -S localhost:8000以启动 Web 服务器,然后在浏览器中查看结果http://localhost:8000/app.php



In the mean time, you can install Apache/PHP/MySQL/etc. on your local box, as the other answers have suggested, either manually or with a package like XAMPP.

同时,您可以安装Apache/PHP/MySQL/etc。在您的本地盒子上,正如其他答案所建议的那样,手动或使用XAMPP 之类的包。

回答by Ignacio Vazquez-Abrams

No. PHP code must be processed by a PHP engine, and the easiest way to do so in a web environment is to use a web server. It does not need to be httpd, but it must be something.

不可以。PHP 代码必须由 PHP 引擎处理,在 Web 环境中执行此操作的最简单方法是使用 Web 服务器。它不需要是 httpd,但它必须是东西

回答by b_dubb

if you are on a Mac, you have Apache installed already. the additional instructions you will need to add PHP and MySQL database server can be found here http://www.entropy.ch/software/macosx/

如果您使用的是 Mac,则您已经安装了 Apache。添加 PHP 和 MySQL 数据库服务器所需的其他说明可以在这里找到http://www.entropy.ch/software/macosx/

if you are using Windows, XAMPP is a self contained Apache/MySQL/PHP environment that runs as a stand alone application.

如果您使用的是 Windows,XAMPP 是一个独立的 Apache/MySQL/PHP 环境,可作为独立应用程序运行。

that should get you started. good luck

这应该让你开始。祝你好运