草庐IT

AUTH_FAILED

全部标签

php - Laravel 5.2 -> 5.3 Auth::user() 返回 null

我已经从5.2升级到5.3,Auth::user()返回null。路线Route::group(['middleware'=>['auth']],function(){Route::get('/test','MyController@showMain');}Controller构造函数调用Auth::check()返回nullpublic$user;publicfunction__construct(){$this->user=Auth::user();}publicfunctionshowMain(){return$this->user;}ControllershowMain调用Au

php - laravel 护照 : Request user() returning null outside auth:api middleware, 和内部返回用户对象

当我尝试使用auth:api中间件获取登录用户的详细信息时,它会在我的Controller函数中返回包含详细信息的用户对象。api.php(withauth:apimiddlewarereturnsUserobject)Route::group(['middleware'=>'auth:api'],function(){Route::get('users/mentor_details/{uuid}','UserController@getMentorProfileDetails');});但是当我试图在这个auth:api中间件之外获取登录用户详细信息时,它返回null。api.php

PHP fatal error : 'Swift_TransportException' with message 'Failed to authenticate on SMTP server

我知道之前有人问过这个问题,我已经阅读了那里的所有帖子,但我仍然找不到解决方案。我有一台安装了wamp的Windows机器。当我尝试通过谷歌的SMTP服务器发送一封简单的电子邮件时,一切正常。但是,当我将相同的脚本复制到Ubuntu12机器时,它给了我这个错误:PHPFatalerror:Uncaughtexception'Swift_TransportException'withmessage'FailedtoauthenticateonSMTPserverwithusername"xxx@gmail.com"using2possibleauthenticators'in/home/

php - Laravel, Controller 中的 Auth::user()

Laravel框架-为什么我不能在Laravel项目的Controller中使用Auth::user()(查看用户是否已登录)。Session是否未连接到Controller?HomeController.phppublicfunctionisauthorized(){if(Auth::user()){returnView::make('home.basic')->with('basic1','Authorized');}else{returnView::make('home.basic')->with('basic1','NotAuthorized');}}我的登录系统正在运行,登录

php - 文件()[函数.文件] : php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

从文件("http://www.otherdomain.com")获取内容时出现以下错误。file()[function.file]:php_network_getaddresses:getaddrinfofailed:Temporaryfailureinnameresolution域服务器是linux。如何解决这个问题? 最佳答案 引用:Ifyou'rehavingproblemswithfopen("url...")butyoucanrun'hosturl'inashellwindowandgetthecorrectlookup

php - Jquery-fileupload 插件 - 上传文件但显示 'file upload failed'

我点击“添加文件”选择一个文件,然后它会创建一个缩略图(取决于浏览器)并在其下方显示“上传”按钮。当我点击“上传”时,有时它会上传文件并提示“文件上传失败”。-文件实际上已上传,但我仍然收到此消息。有时它不会上传,我会收到相同的消息。我有两个错误-第一个在PHP错误日志中'PHPWarning:exif_imagetype():Filenamecannotbeemptyin***\***\UploadHandler.php'我不明白不过,它一直都是。第二个是页面上的jquery.validation-'UncaughtError:Syntaxerror,unrecognizedexpr

php - 警告 : ssh2_connect(): Failed overriding server to client COMP method

我在为PHP中的SSHsession启用压缩时遇到问题。部分代码:$methods=array('server_to_client'=>array('comp'=>'zlib'));if(!($con=ssh2_connect("10.214.201.31",22,$methods))){...执行期间的警告(通过httpd或phpcli):Warning:ssh2_connect():FailedoverridingservertoclientCOMPmethod压缩不起作用(通过ssh2_scp_recv下载测试文件的时间没有改变)。设置客户端到服务器压缩后出现类似警告。PHPVe

php - Auth guard 驱动程序 [api] 未定义

我正在使用laravel5.4并使用jwtauthjwt版本是jwt-auth"tymon/jwt-auth":"0.5.*"在auth.php中我有'guards'=>['web'=>['driver'=>'session','provider'=>'users',],'api'=>['driver'=>'jwt','provider'=>'users',],],在Api.php中我有Route::post('/login','HomeController@authenticate');Route::group(['prefix'=>'v2','middleware'=>'auth:

php - CakePHP ACL 和 Auth 不工作

我有几个关于CakePHP的ACL和Auth系统的问题。acos表中别名的命名约定是什么?是“controllers/Posts/add”还是仅使用“Posts”中的父ID进行“添加”?我的登录无效。当我尝试登录时,我没有收到任何错误消息,但Auth.User和Auth->user('id')都是空的。可能是什么问题呢?我做的一切都像CakePHP的ACL示例中那样。谢谢。更新:我现在可以登录(服务器上的时间设置有问题),我的acos表看起来正确,但我无法执行任何操作。我允许aros_acos表中的操作。如果我使用'$this->Acl->check()'检查权限,如果我给出操作的单个

php - 文件获取内容(): Failed to enable crypto

当我尝试从谷歌获取图片时,它为一次搜索提供了4张图片,但由于图片大小,我无法获取一些图片。这样我就会收到类似的错误"file_get_contents():Failedtoenablecrypto"有什么解决办法吗?这是我的代码all();$sql_2="TRUNCATE`tn_gift_google_image`";$query_1=Yii::$app->db->createCommand($sql_2)->execute();functionget_url_contents($url){$crl=curl_init();curl_setopt($crl,CURLOPT_USERAG