• 部署php程序报错解决---TP框架


    1、TP框架中 出现如下错误:     

    访问网站 http://192.168.0.204/

    STORAGE_WRITE_ERROR_:./Runtime/Cache/Home/51620d75af91aa77adc53082d1113d54.php
    错误位置
    FILE: /www/wwwroot/default/ThinkPHP/Library/Think/Storage/Driver/File.class.php  LINE: 47

    TRACE
    #0 /www/wwwroot/default/ThinkPHP/Library/Think/Storage/Driver/File.class.php(47): E('_STORAGE_WRITE_...')
    #1 [internal function]: ThinkStorageDriverFile->put('./Runtime/Cache...', ' #2 /www/wwwroot/default/ThinkPHP/Library/Think/Storage.class.php(42): call_user_func_array(Array, Array)
    #3 /www/wwwroot/default/ThinkPHP/Library/Think/Template.class.php(110): ThinkStorage::__callstatic('put', Array)
    #4 /www/wwwroot/default/ThinkPHP/Library/Think/Template.class.php(76): ThinkTemplate->loadTemplate('/www/wwwroot/de...', '')
    #5 /www/wwwroot/default/ThinkPHP/Library/Behavior/ParseTemplateBehavior.class.php(32): ThinkTemplate->fetch('/www/wwwroot/de...', Array, '')
    #6 /www/wwwroot/default/ThinkPHP/Library/Think/Hook.class.php(123): BehaviorParseTemplateBehavior->run(Array)
    #7 /www/wwwroot/default/ThinkPHP/Library/Think/Hook.class.php(89): ThinkHook::exec('Behavior\ParseT...', 'run', Array)
    #8 /www/wwwroot/default/ThinkPHP/Library/Think/View.class.php(123): ThinkHook::listen('view_parse', Array)
    #9 /www/wwwroot/default/ThinkPHP/Library/Think/View.class.php(72): ThinkView->fetch('/www/wwwroot/de...', '', '')
    #10 /www/wwwroot/default/ThinkPHP/Library/Think/Controller.class.php(56): ThinkView->display('/www/wwwroot/de...', '', '', '', '')
    #11 /www/wwwroot/default/ThinkPHP/Library/Think/Controller.class.php(290): ThinkController->display('/www/wwwroot/de...')
    #12 /www/wwwroot/default/ThinkPHP/Library/Think/Controller.class.php(187): ThinkController->dispatchJump('xE7xABx99xE7x82xB9xE5xB7xB2xE7xBBx8FxE5x85xB3...', 0, '', false)
    #13 /www/wwwroot/default/Application/Home/Controller/HomeController.class.php(31): ThinkController->error('xE7xABx99xE7x82xB9xE5xB7xB2xE7xBBx8FxE5x85xB3...')
    #14 /www/wwwroot/default/ThinkPHP/Library/Think/Controller.class.php(41): HomeControllerHomeController->_initialize()
    #15 /www/wwwroot/default/ThinkPHP/Common/functions.php(535): ThinkController->__construct()
    #16 /www/wwwroot/default/ThinkPHP/Library/Think/App.class.php(79): A('Index')
    #17 /www/wwwroot/default/ThinkPHP/Library/Think/App.class.php(181): ThinkApp::exec()
    #18 /www/wwwroot/default/ThinkPHP/Library/Think/Think.class.php(117): ThinkApp::run()
    #19 /www/wwwroot/default/ThinkPHP/ThinkPHP.php(94): ThinkThink::start()
    #20 /www/wwwroot/default/index.php(34): require('/www/wwwroot/de...')
    #21 {main}

    解决:出现这样原因是因为 源码包所在的目录权限不够   

    源码包放在了  /www/wwwroot/default/

     [root@bogon ~]# ls /www/wwwroot/default/

    Addons Application doc favicon.ico info.php Public ThinkPHP wx
    api Data errpage index.php pma_6a8f9f27 Runtime Uploads
    [root@bogon ~]# cd /www/wwwroot/
    [root@bogon wwwroot]# chmod -R 777 default/

    2、浏览器访问总是出现站点已关闭

    场景: 之前把公司线上的php源码包拿到笔记本的虚拟机上测试部署,部署完成后通过浏览器访问总是出现站点已关闭

    原因:把线上php程序配置文件config.php里面的数据库连接信息改成了笔记本虚拟机的数据库连接信息,所有报错

    解决:把config.php里面的数据库连接信息 重新改回来即可,就是说拿来线上的php程序里面的数据库信息不要动

    [root@bogon conf.d]# vi /www/wwwroot/default/Application/Common/Conf/config.php

    /* 数据库配置 */
    'DB_TYPE' => 'mysqli', // 数据库类型
    'DB_HOST' => 'rf-wz91fw8763zf022573fo.mysql.rds.aliyuncs.com', // 服务器地址
    'DB_NAME' => 'ayziyun', // 数据库名
    'DB_USER' => 'ayziyun', // 用户名
    'DB_PWD' => 'ki8uyYUUU_lknh', // 密码
    'DB_PORT' => '3306', // 端口
    'DB_PREFIX' => 't_', // 数据库表前缀
    'DB_CHARSET'=> 'utf8mb4',

  • 相关阅读:
    30分钟全面解析-SQL事务+隔离级别+阻塞+死锁
    apache 不执行PHP,显示代码
    ERROR 1406 : Data too long for column 解决办法
    apache下php无法解析直接显示源代码解
    win7系统,apache2.2下添加PHP5的配置详解
    apache 添加到windows服务
    升级3.2.3后 could not find driver
    Windows server 2008搭建php运行环境
    MySQL 5.6 for Windows 解压缩版配置安装
    Linux vi/vim替换命令的使用说明[转]
  • 原文地址:https://www.cnblogs.com/effortsing/p/10124098.html
Copyright © 2020-2023  润新知