简体   繁体   English

在Azure Web App服务中部署wwwroot之外的PHP文件

[英]Deploying PHP files outside of wwwroot in Azure Web App service

Usually, when you deploy a PHP Web APP in Azure, you will put it under /home/site/wwwroot so that all scripts are accessible from the web. 通常,在Azure中部署PHP Web APP时,您将把它放在/home/site/wwwroot以便可以从Web访问所有脚本。

However, I have some constants (like clientId + clientSecret among others) that I don't want to expose to the internet for safety reasons. 但是,我有一些常量(比如clientId + clientSecret等)我出于安全原因不想暴露给互联网。 I have a constants.php file for that purpose. 我有一个constants.php文件用于此目的。

As a result, I would like to know if the following folder tree would work as expected and it's safe: 因此,我想知道以下文件夹树是否可以按预期工作并且它是安全的:

/home/site/wwwroot/index.php
/home/site/constants.php

I'm not doing the deploy and can't test it by myself. 我没有进行部署,也无法自己测试。

If you only have statements defining constants or variables in constants. 如果只有在常量中定义常量或变量的语句。 php, it's safe to put them anywhere. php,将它们放在任何地方都是安全的。

What you need to be aware of is that when other files load it, they will not output file contents or variables | 您需要注意的是,当其他文件加载它时,它们不会输出文件内容或变量 constants for any reason. 任何原因的常数。

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

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