小编50l*_*l3r的帖子

CodeIgniter数据库会话错误

当我尝试执行我的CodeIgniter项目的任何控制器时,我收到此错误:

Fatal error: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read) in D:\Git\crud-farm\system\libraries\Session\drivers\Session_files_driver.php on line 49
A PHP Error was encountered

Severity: Error

Message: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read)

Filename: drivers/Session_files_driver.php

Line Number: 49

Backtrace:
Run Code Online (Sandbox Code Playgroud)

我试图替换CodeIgniter系统文件,但它不起作用.问题出现在所有项目中

php database session codeigniter

6
推荐指数
1
解决办法
1万
查看次数

PHP SQL Server 2008 错误定位指定的服务器/实例 [xFFFFFFFF]

我在将 Windows Apache 连接到 SQL Server Express 2008 时遇到问题

PHP 版本 5.2.9

Apache 版本 Apache/2.2.11 (Win32)

<?php
$serverName = "serverName\SQLEXPRESS"; //serverName\instanceName
$connectionInfo = array( "Database"=>"dbName", "UID"=>"userName", "PWD"=>"password");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {
     echo "Connection established.<br />";
}else{
     echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));
}
?>
Run Code Online (Sandbox Code Playgroud)

我尝试使用 mssql 和 sqlsrv 驱动程序,但无法连接到数据库。这些驱动程序已正确启用。 mssql 配置 sqlsrv 配置

我可以连接 sqlcmd 应用程序并成功执行查询:

sqlcmd -S serverName\SQLEXPRESS-U userName-P password
Run Code Online (Sandbox Code Playgroud)

当我尝试连接 mssql 驱动程序时:

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: serverName\SQLEXPRESS in …
Run Code Online (Sandbox Code Playgroud)

php sql-server apache sql-server-2008

2
推荐指数
1
解决办法
5460
查看次数

然后调用Axios 400错误请求而不是catch

我有这个功能:

add(App, Params, Callback){
    var self = this;

    var Data = self.process_fields(Params)

    self.$http.post(
        paths.api + '/app/' + App.Permalink,
        new URLSearchParams(Data)
    ).then(function (error, response) {
        console.log("then");
        if (typeof (Callback) == "function") {
            Callback(true, response.data.data);
        }
    }).catch(function(error){
        console.log("catch");
        if(typeof error.response !== "undefined"){
            errors.render(error.response.data.error)
        }

        if (typeof (Callback) == "function") {
            Callback(false, null);
        }
    });
}
Run Code Online (Sandbox Code Playgroud)

当我致电request并收到400错误时,它致电,而不是catch:

在此处输入图片说明

javascript ajax vue.js axios

2
推荐指数
2
解决办法
2632
查看次数

无法使用javascript中的Google翻译返回默认语言

我有一个代码使用google-translate和jquery.cookie将所有页面翻译成其他语言:

$(document).ready(function () {
    var googTrans = $.cookie('googtrans');

    if (googTrans === '/es/en') { //Paint specific flag
        var src = $('.lang-change img').attr('src').replace('flag_en.png', 'flag_es.gif');
        $('.lang-change img').attr('src', src);
        $('#lang-change-en').attr('id', 'lang-change-es');
    }

    $(".lang-change").on("click",function(){
        if (googTrans == '/es/en') { //If language is english return to spanish
            $.removeCookie('googtrans',{path:'', domain: 'domain.es'});
            $.removeCookie('googtrans',{path:'', domain: '.domain.es'});
            location.reload();
        }else{ //Convert to english
            $.cookie('googtrans','/es/en',{path:''});
            location.reload();
        }
    });
});

//Google provides this function
function googleTranslateElementInit() {
    new google.translate.TranslateElement({
        pageLanguage: 'es',
        includedLanguages: 'en',
        layout: google.translate.TranslateElement.InlineLayout.SIMPLE,
        autoDisplay: false
    }, 'google_translate_element');
}
Run Code Online (Sandbox Code Playgroud)

googtrans cookie将我设置为会话:

在此处输入图片说明

我无法删除此cookie并返回我的原始语言

javascript cookies callback google-translate jquery-cookie

1
推荐指数
1
解决办法
2316
查看次数

Webpack Dev Server代理不会重定向到api后端

我尝试将我的“ http:// localhost:3000 / api / ”路径重定向在apache服务器中运行的“ http://example.com/api/ ”。

这是我的devServer配置:

devServer: {
    publicPath: '/build/',
    port: 3000,
    proxy: {
        '/api': {
            target: 'http://gestios.loc/api'
        }
    },
    historyApiFallback: true
}
Run Code Online (Sandbox Code Playgroud)

当我尝试访问http:// localhost:3000 / api / calltek / apps?permalink = empresas时,收到404错误。

Request URL:http://localhost:3000/api/calltek/apps?permalink=empresas
Request Method:GET
Status Code:404 Not Found
Remote Address:127.0.0.1:3000
Referrer Policy:no-referrer-when-downgrade

HTTP/1.1 404 Not Found
X-Powered-By: Express
date: Fri, 05 May 2017 18:13:42 GMT
server: Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.6.28
vary: accept-language,accept-charset
accept-ranges: bytes
connection: close
transfer-encoding: …
Run Code Online (Sandbox Code Playgroud)

javascript apache angularjs webpack webpack-dev-server

1
推荐指数
1
解决办法
2908
查看次数

将oauth 2.0服务器与codeigniter集成

我想集成一个oauth 2.0服务器系统来从外部访问我的登录

我在互联网上找到了CodeIgniter-OAuth-2.0-Server,但该代码似乎已被弃用.将它与我的codeigniter集成是一个坏主意?

您知道我的codeigniter的其他项目oauth 2.0服务器吗?

非常感谢

codeigniter oauth-2.0

0
推荐指数
1
解决办法
2万
查看次数