简体   繁体   English

从浏览器运行Phar文件

[英]Running phar files from a browser

Is it possible to run .phar files from a browser? 是否可以从浏览器运行.phar文件? A couple of sites seem to suggest that it is, but I can't find any details on how to set it up. 几个站点似乎都建议这样做,但是我找不到有关如何设置它的任何详细信息。

I can run phar files directly from the CLI, but not from a browser. 我可以直接从CLI运行phar文件,但不能从浏览器运行。 I'm using IIS. 我正在使用IIS。 What do I need to do to make it work? 我需要做些什么才能使其正常工作?

I'm on PHP 7.2 and IIS 8.5. 我使用的是PHP 7.2和IIS 8.5。

I know I can "include" them in regular php scripts, but I want to know how to run them directly. 我知道我可以在常规的php脚本中“包含”它们,但是我想知道如何直接运行它们。

You have to tell IIS that .phar files should be handled with the PHP CGI process. 您必须告诉IIS .phar文件应通过PHP CGI进程处理。

See https://docs.microsoft.com/de-de/iis/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php 请参阅https://docs.microsoft.com/de-de/iis/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php

In step 14 "Add Module Mapping", you need to set the "Request Path" to *.phar . 在步骤14“添加模块映射”中,您需要将“请求路径”设置为*.phar

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

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