doudilin1225 2012-06-30 07:52
浏览 58
已采纳

将PHP框架放在Linux主机上的位置

I have a Linux (CentOS) host that hosts 5 websites of mine. There are two different PHP frameworks (Yii & Zend), each of my sites is based on one of them. Where would be an appropriate place to keep them, with what permissions? I though of two variants but I have doubts that any of them is the right thing to do.

In my projects, which reside in for example /home/example.com/public_html/index.php I would do require_once($pathToFrameworkInitFile)

Variant 1:

Under /usr/local/, user root with permissions 755:

/usr/local/frameworks/yii/yii-1.1.9/
/usr/local/frameworks/yii/yii-1.1.10/
/usr/local/frameworks/zend/zend-1.11.12/

Variant 2:

Under user frameworks with permissions 755: /home/frameworks/yii/yii-1.1.9/ /home/frameworks/yii/yii-1.1.10/ /home/frameworks/zend/zend-1.11.12/

Variant 3:

I hope that you might suggest something better.

As you suppose - I have full root access to the host and I'm managing both websites and host myself, so I'm looking for the best (or at least good enough) practice.

  • 写回答

2条回答

  • douguio0185 2012-07-02 08:54
    关注

    After reading more about the Unix FS Hierarchy Standard, I decided to put the frameworks in:

    /opt/php-frameworks/yii-(version)
    /opt/php-frameworks/zend-(version)
    

    With permissions 755, under the root account. Most best practices say that the framework should be out of the docroot and /opt seems ideal for such libraries as php frameworks.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler