草庐IT

ssh2_auth_pubkey_file

全部标签

php - 即使 file_exists() 声明文件存在,require() 也会失败

这是我的代码:if(file_exists('config.php')){require('config.php');//Thisisline38}以某种方式产生错误:Warning:require(config.php)[function.require]:failedtoopenstream:Nosuchfileordirectoryin/path/name/file.phponline38这怎么可能?更新:以下确实有效:if(file_exists(getcwd().'/config.php')){require(getcwd().'/config.php');}

php - 在 Laravel 5.1 中使用中间件时出现 Class jwt-auth does not exist 错误

我按照官方的JWT-Auth安装https://github.com/tymondesigns/jwt-auth/wiki/Installation.现在我的Controller中有一个中间件:$this->middleware('jwt-auth',['only'=>['postChange','postChoose']]);我还在config/app.php的提供程序数组中添加了Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class但是,当我向API发出请求时,我收到此错误消息:ReflectionExceptioninConta

php - 密码/商业 secret 算法 : Are they safe in php files?

我的网站是使用php文件构建的。我在这些文件中使用了商业secret算法,我的数据库根密码也存储在这些php文件中。我的数据库用于存储许多客户的私有(private)医疗数据。这是否被认为是安全的设置?任何人都可以从我的网络服务器下载php源代码,因此可以访问我的rootmysql密码吗?我在ubuntu8.04和mysql5上运行apache2.0和php5。谢谢。 最佳答案 如果您在美国存储医疗数据,您将受到特定、严格的securityrequirements.其他国家可能有类似规定。如果不是专家,我严重怀疑您能否通过您描述的设

php - 处理多维 $_FILES 数组

我有以下$_FILES数组用于从支持表单进行处理Array([file]=>Array([name]=>Array([0]=>Test.jpg[1]=>Test.doc[2]=>Test.php[3]=>)[type]=>Array([0]=>image/jpeg[1]=>image/jpeg[2]=>image/jpeg[3]=>)[tmp_name]=>Array([0]=>/tmp/phpCO0vSD[1]=>/tmp/phpEFpp3Q[2]=>/tmp/phpwN4Iwc[3]=>)[error]=>Array([0]=>0[1]=>0[2]=>0[3]=>4)[size]=

php - 拉维尔 4 : Stock Auth login won't persist across pages

从所有教程中,我应该能够对用户进行身份验证,然后跳转到任何其他页面,并保持登录。然而,这不起作用。自定义编译的PHPLAMP堆栈。应用存储是可写的。与教程的唯一区别是我使用的是电子邮件而不是用户名。http://laravelbook.com/laravel-user-authentication/http://codehappy.daylerees.com/authenticationsession有效,因为我能够将var存储到session并在不同的页面上读出它。models/User.php(股票)useIlluminate\Auth\UserInterface;useIllum

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 包含 - 无法打开流 : No such file

我用HTML编写了一个网站,但后来我想将页眉和导航栏部分放在一个文件中,所以我只需要更改一次即可。我将所有页面更改为.php并添加了php包含。但是,现在我在放入文件夹的页面上出现错误,因此我可以创建简洁的链接。头文件:/test/assets/header.php作品:/test/index.php包含抛出错误:/test/company/index.php包含错误:Warning:include(/test/assets/header.php)[function.include]:failedtoopenstream:NosuchfileordirectoryWarning:inc

php - 使用 simplexml_load_file() 加载压缩的 XML 文件

我正在尝试使用simplexml_load_file()PHP函数加载一个gzip压缩的XML文件,但我不知道如何解码它以便我可以使用其中的数据。 最佳答案 PHP有supportforzlibcompression内置,只需在文件的路径前加上gzip数据compress.zlib://就可以了:$xml=simplexml_load_file("compress.zlib://test.xml");像魅力一样工作。 关于php-使用simplexml_load_file()加载压缩的X

php - 使用 file_get_contents() 时出现问题

我有两台电脑。我在两台计算机上都配置了Web服务器并且都在工作。现在我想使用file_get_contents()从第二个URL访问第一个URL。第一个网址:http://46.7.234.111:8080/server/test_curl.php第二个网址:http://spicegururathgar.ie/client/test_curl.php访问第一个URL的代码:$url="http://46.7.234.111:8080/server/test_curl.php";$url='http://'.str_replace('http://','',$url);//Avoida

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