在 Bluemix 中,如果我从 php 模板开始创建应用程序,则 DocumentRoot 设置为:
/htdocs
.
我实际上想要一个像这样的目录结构:
/htdocs
/public_html
index.php
/myCode
myPhpClass.php
使用 httpd.conf DocumentRoot="${HOME}/htdocs/public_html"。
所以我尝试推送这个社区 buildpack https://github.com/cloudfoundry/php-buildpack.git从我本地的 myAppName 目录:
/var
/www
/myAppName
/public_html
index.php
/myCode
myOhoClass.php
/.bp-config
options.json
使用对比:
[... myAppName]# cf push -s cflinuxfs2 -m 128M -b https://github.com/cloudfoundry/php-buildpack.git myAppName
其中 options.json 文件:
{
"WEBDIR": "htdocs/public_html"
}
但我最终在 Bluemix 中得到的是:
/htdocs
/public_html
/public_html
index.php
/myCode
myPhpClass.php
有没有办法在 Bluemix 中为 apache httpd/php 应用程序提供自定义目录结构?
最佳答案
您的 .bp-config/options.json
文件有点错误。应该是下面的。
{
"WEBDIR": "public_html"
}
我自己尝试了一个 PHP 应用程序,它运行良好。
cf push php-test-jbs -b https://github.com/cloudfoundry/php-buildpack.git -s cflinuxfs2
此外,要部署示例,请单击以下。
或转到 Github project查看完整示例。
关于php - 如何在 Bluemix php 中部署自定义骨架应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32719343/