在openshift中为cakephp 3配置DocumentRoot

时间:2015-05-18 20:41:56

标签: openshift cakephp-3.0

好我是OpenShift的新用户,今天我阅读了文档,但目前尚不清楚,我如何配置DocumentRoot。在我的情况下,我使用cakephp 3并将我的应用程序投入生产我需要配置DocumentRoot,这应该是webroot for production,我对OpenShift非常感兴趣,我只需要解决这个问题来携带我的应用程序云端。我读到OpenShift设置了DocumentRoot但是如果它适用于我的情况则没有。

1 个答案:

答案 0 :(得分:1)

好吧,如果无法手动更改DocumentRoot设置(只需询问他们的支持),那么您可以重命名应用webroot目录,使其符合OpenShifts自动文档根检测功能:< / p>

  

[...]

     

盒式磁带控制脚本逻辑根据以下顺序的条件选择DocumentRoot:

IF php/ dir exists THEN DocumentRoot=php/
ELSE IF public/ dir exists THEN DocumentRoot=public/
ELSE IF public_html/ dir exists THEN DocumentRoot=public_html/
ELSE IF web/ dir exists THEN DocumentRoot=web/
ELSE IF www/ dir exists THEN DocumentRoot=www/
ELSE DocumentRoot=/
     

[...]

<强> https://developers.openshift.com/en/php-getting-started.html#set-document-root

如果你问他们,他们甚至可以考虑在他们的脚本中添加webroot

更改应用程序webroot目录

要更改应用程序webroot目录,您需要做两件事

  1. 根据需要更改目录名称(例如更改为public

  2. 相应地调整应用WWW_ROOT文件中的config/paths.php常量(例如define('WWW_ROOT', ROOT . DS . 'public' . DS);