Aphsss
V2EX  ›  问与答

求助: codeigniter 框架在服务器出错了

  •  
  •   Aphsss · May 14, 2015 · 2682 views
    This topic created in 4112 days ago, the information mentioned may be changed or developed.
    自己刚刚学习的codeigniter,用的是codeigniter3.0 。

    在本地用的WampServer 2.2(MySQL 5.5.20。PHP 5.3.10, APACHE 2.2.21 ) 完全正常,

    服务器用的是军哥的 http://lnmp.org/lnmpa.html (启用MySQL InnoDB,PHP 5.3.28 ,MariaDB 5.5.37)。

    网站文件时sftp上传,目录已执行:

    chown -R www:www /home/wwwroot/orz.p1ng.org
    chmod -R 777 /home/wwwroot/orz.p1ng.org

    现在是这个样子 http://orz.p1ng.org/

    Message: mkdir(): open_basedir restriction in effect. File() is not within the allowed path(s): (/home/wwwroot/orz.p1ng.org:/tmp/:/var/tmp/:/proc/)
    。。。好多问题

    我查看apache的http.conf文件应该也是没问题的
    http.conf文件如下:
    <VirtualHost *:88>
    ServerAdmin [email protected]
    php_admin_value open_basedir "/home/wwwroot/orz.p1ng.org:/tmp/:/var/tmp/:/proc/"
    DocumentRoot "/home/wwwroot/orz.p1ng.org"
    ServerName orz.p1ng.org
    #ErrorLog "logs/-error_log"
    #CustomLog "logs/-access_log" common
    </VirtualHost>

    自己百度了好多,不知道该怎么办了,求教。先在这里谢谢大家了
    Supplement 1  ·  May 14, 2015
    好了,解决了 。

    确实是 session.save_path的问题。
    在php.ini 加入 session.save_path= "/tmp/" (取消前面的;)

    重启环境。

    谷歌看这,原来的报错信息类似
    A PHP Error was encounteredSeverity: Warning
    Message: include(): open_basedir restriction in effect. File() is not within the allowed path(s): (/usr/local/apache/htdocs:/tmp:/proc)
    Filename: core/Router.php
    Line Number: 138


    A PHP Error was encounteredSeverity: Warning
    Message: include(): open_basedir restriction in effect. File() is not within the allowed path(s): (/usr/local/apache/htdocs:/tmp:/proc)
    Filename: core/Output.php
    Line Number: 103

    A PHP Error was encounteredSeverity: Warning
    Message: require(): open_basedir restriction in effect. File() is not within the allowed path(s): (/usr/local/apache/htdocs:/tmp:/proc)
    Filename: core/Common.php
    Line Number: 145

    多谢 @kungfuchicken
    3 replies    2015-05-14 23:56:26 +08:00
    kungfuchicken
        1
    kungfuchicken  
       May 14, 2015   ❤️ 1
    PHP配置SESSION文件的路径不在 openbase_dir允许的路径里面导致无法写入session文件
    修改php.ini里面的session.save_path把路径改为你open_basedir的里面任意一个路径或者把session.save_path的路径加入到open_basedir即可
    zeacev
        2
    zeacev  
       May 14, 2015
    哥们,777权限用在服务器上是不是有冒险了点
    Aphsss
        3
    Aphsss  
    OP
       May 14, 2015
    @zeacev 多谢提醒,其实这个是为了排除权限不得已做的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5516 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 08:49 · PVG 16:49 · LAX 01:49 · JFK 04:49
    ♥ Do have faith in what you're doing.