草庐IT

Pull-to-Refresh

全部标签

php - Laravel 5.2 curl_init() 抛出错误 "Call to undefined function"

我正在尝试使用curl在laravel中使用FCM,但出现错误。首先,我在我的一个Controller中编写了一个php代码:$first_name=$request->input('first_name');//FCMapiURL$url='https://fcm.googleapis.com/fcm/send';//api_keyavailableinFirebaseConsole->ProjectSettings->CLOUDMESSAGING->Serverkey$server_key='AIzaSyA1RyuAGGPASh_flFCwiyd9ZHEMYlhQOho';$tar

php - Laravel "Call to undefined method"仅在生产中发生

我有2个Controller函数,它们调用位于应用程序文件夹下的类的静态函数。Controller\UserResController.phppublicfunctionshow($id,Request$request){return\App\User::show($id,$request);}Conrtollers\Other\UserResController.phppublicfunctionshow($id,Request$request){//othercodesreturn\App\User::show($id,$request);}应用\用户.phppublicstati

php - 创建资源 : [message] fopen(): Unable to find the wrapper "https" on Ubuntu using Symfony 时出错

我正在尝试在Ubuntu17.04机器上安装Symfony3,但出现错误:[GuzzleHttp\Ring\Exception\RingException]Errorcreatingresource:[message]fopen():Unabletofindthewrapper"https"-didyouforgettoenableitwhenyouconfiguredPHP?[file]phar:///usr/local/bin/symfony/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php[line]406[messag

php - Laravel 邮件 : How to pass ->attachData to view

我正在尝试在Laravel邮件中使用内联附件,但似乎很不幸。我也试过这个one但不能通过嵌入原始数据来工作。我有一个base64图像/png这里是一个example现在我正在尝试使用attachData,但如何将->attachData传递到我的mailtransaction.blade。我应该从我的Controller获取attachData但我应该调用什么变量?Controller.phpMail::send(['html'=>'mailtransaction'],$data_content,function($msg)use($to,$issueType,$base64){$ms

php - Laravel 和 Eclipse : How to avoid errors in default code of Laravel 5. 5?

我在Laravel中创建了一个新项目,并使用EclipseIDE(适用于PHP)将其打开,但Laravel为路由生成的默认代码出现错误。我怎样才能防止这种情况发生?我只创建了项目并用Eclipse打开了它,但出现了该错误。 最佳答案 在文件顶部导入Route门面,如Request。useIlluminate\Support\Facades\Route;我推荐使用这个包,barrydvh/ide-helper,在你的项目中。它会生成Laravel外观和其他静态方法的映射,而IDE在开箱即用时会遇到问题。您还需要安装EclipsePHP

PHP 启动 : Unable to load dynamic library 'openssl' in Ubuntu

我在问题的标题中收到了错误消息,或者确切地说,我收到了这条消息PHPStartup:Unabletoloaddynamiclibrary'openssl'(tried:/usr/lib/php/20170718/openssl(/usr/lib/php/20170718/openssl:cannotopensharedobjectfile:Nosuchfileordirectory),/usr/lib/php/20170718/openssl.so(/usr/lib/php/20170718/openssl.so:cannotopensharedobjectfile:Nosuchfil

php - iphone SDK : Upload image from iphone to a php Server send empty file ?(里面有示例代码链接)

我尝试通过PHP将照片和GPS位置发送到服务器这是PHP部分:Copyfromhere保存上传的文件以上示例在服务器上的PHP临时文件夹中创建上传文件的临时副本。脚本结束时,临时复制的文件会消失。要存储上传的文件,我们需要将其复制到不同的位置:0){echo"ReturnCode:".$_FILES["file"]["error"]."";}else{echo"Upload:".$_FILES["file"]["name"]."";echo"Type:".$_FILES["file"]["type"]."";echo"Size:".($_FILES["file"]["size"]/10

php - 如何检测 stream_copy_to_stream 错误?

我有一些代码,简化后看起来像这样:$fout=fsockopen($host,80);stream_set_timeout($fout,10*3600);//10hours$fin=fopen($file,'rb');//notreallyafilestream,butgoodenoughproxyhere$readbytes=stream_copy_to_stream($fin,$fout);if(!$readbytes)die('copyfailed');但是,我有时会遇到以下类型的错误:Notice:stream_copy_to_stream():sendof952bytesfa

php - Zend 框架 : How to give specific order to javascript files and scripts

我在布局中包含以下javascript文件:$this->InlineScript()->appendFile($this->baseUrl('resource/js/jquery.js'));$this->InlineScript()->appendFile($this->baseUrl('resource/js/main/login.js'));$this->InlineScript()->offsetSetFile(3,$this->baseUrl('resource/js/core.js'));我在View文件中有以下脚本:InlineScript()->captureStar

PHP xml阅读器: How to cache xsd schema?

我正在使用PHPxmlreader来验证和解析xml数据。此xml通过XMLReader::setSchema函数使用来自本地文件的一些xsd模式和通过xsd:import/include来自http://的远程xsd模式进行验证。一切正常,但每次调用时它都会从网络中获取xsd模式并从磁盘读取。所以我的问题是:是否有在本地RAM中缓存远程xsd模式的方法?对于本地模式文件,我认为Linux中的tmpfs可以正常工作,但是否有另一种方法来缓存本地xsd模式文件?解决方案感谢VolkerK指出xmlcatalog系统。它适用于libxml/phpxmlreader。在Linux中,只需编辑