为什么在文件夹中的public_html codeIgniter应用程序文件? [英] Why are CodeIgniter application files in the public_html folder?

查看:200
本文介绍了为什么在文件夹中的public_html codeIgniter应用程序文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是不是有所有的文件在公众视野是一件坏事?

Isn't having all of the files in public view a bad thing?

当然的事情,如/system/application/config/database.php不应该公开可见!

Surely things such as /system/application/config/database.php should not be publicly visible!

推荐答案

的codeIgniter开发商,EllisLabs,建立了以这种方式易于使用的框架。这意味着,人们希望尝试的框架没有与他们的服务器上的任何权限设置乱动。

The developers of CodeIgniter, EllisLabs, have set up the framework in this way for ease of use. It means that people wishing to try out the framework don't have to fiddle with any permissions settings on their server.

当然,在生产服务器上,你是绝对正确的,把你的PHP文件中公开的HTML文件夹是不是一个好主意。

Of course on a production server, you are absolutely right, putting your PHP files in the public HTML folder is not a good idea.

有一个更好的方式来组织你的文件夹是:

A better way to organise your folders would be:




    • code_igniter

      • application_folder

        • 配置

        • 控制器

        • 模式

        • ...


        • CSS

        • JS​​

        • 图片
          的index.php
          的.htaccess

        在这里所做的唯一改变是改变的index.php的26行改为:

        The only other change to be made here would be to change line 26 of index.php to read:

        $system_folder = "../../code_igniter/system-folder";
        

        这篇关于为什么在文件夹中的public_html codeIgniter应用程序文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆