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 有偿求码,CNN+LSTM实现单通道脑电信号EEG的睡眠分期评估
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路