首页 > 解决方案 > Firebase .htaccess 到 json

问题描述

我搜索并发现 .htaccess 仅在 firebase 中不起作用 firebase.json 我想让 firebase.json 在 .htaccess 中像这样将 .html 文件读取到 php

[Apache2 @ Ubuntu/Debian: use this directive]

AddType application/x-httpd-php .html .htm
Or, from comment below:

AddType application/x-httpd-php5 .html .htm
If your are running PHP as CGI (probably not the case), you should write instead:

AddHandler application/x-httpd-php .html .htm 

标签: phpfirebase.htaccessfirebase-hosting

解决方案


Firebase 托管不支持评估 PHP 代码。事实上,它并不直接支持任何后端代码执行。

您通过 Firebase 托管运行后端代码的选项仅限于与 Cloud Functions 和 Cloud Run的集成。如果您必须运行 PHP,那么 Cloud Run 是您唯一的选择,要完全配置和运行该解决方案将是一项相当大的工作量。


推荐阅读