草庐IT

output_stream

全部标签

php - 正则表达式(php 中的 preg_match): last groups in the output array don't work correctly

使用这种模式:(howis\s)?(the\s)?(weather)\s?((on)\s)?(today|tomorrow|sunday|monday|tuesday|wednesday|thursday|friday|saturday|sunday|thisweek)?(\s(in)\s(.*)\s?(on)?\s?(today|tomorrow|sunday|monday|tuesday|wednesday|thursday|friday|saturday|sunday|thisweek)?)?这就是我要捕捉的东西输入:维也纳星期二的天气怎么样输出:array(100=>howis

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 - GAE、PHP 和 GCM : failed to open stream: HTTP request failed! HTTP/1.0 405 方法不允许

我正在开发一个Web应用程序(使用适用于PHP的GAE),它会在某些内容可供下载时通知Android客户端(通过GCM-GoogleCloudMessaging)。下面的PHP脚本应该可以完成工作:$json=array('data'=>array(...),'registration_ids'=>array(...));$data=json_encode($json);$context=array('http'=>array('method'=>'post','header'=>'Authorization:key=MY_SECRET_KEY'."\r\n".'Content-Typ

php - Facebook 图形 API : Parsing the output

我正在尝试通过此调用使用FBGraphAPI获取friend的姓名:$friends=file_get_contents('https://graph.facebook.com/me/friendsaccess_token='.$session["access_token"]);echo"Friends:$friends\n";这给了我一个表单列表:{"data":[{"name":"ABCXYZ","id":"12212839"},{"name":"PQRGHI","id":"5004678"}]}我希望能够仅将NAMES存储在数组中。我如何使用$friends来获取名字?$frie

php - 如何获得 facebook 应用程序的 publish_stream 权限?

我有一个已经运行了一段时间的应用程序,它只请求了一些用于登录目的的帐户信息。现在我想用它来发布到流。我已将publish_stream添加到req_perms,但它仍然没有请求该权限。我错过了什么吗?FACEBOOKAPPID,'secret'=>FACEBOOKSECRET,'cookie'=>false,));$fb_session=$facebook->getUser();$fb_me=null;//SessionbasedAPIcall.if($fb_session){try{$fb_uid=$fb_session;$fb_me=$facebook->api('/me');$f

PHP 警告 : require_once(/var/www/html/wp-config. php) : failed to open stream: Permission denied in/var/www/html/wp-load. php on line 37

我正在apache上创建一个Wordpress应用程序服务器,在访问url时收到错误500。因此,我确实检查了httpd/logs/error_log,以下是错误[SunJan1522:42:54.4403492017][:error][pid767][client10.203.116.148:9173]PHPWarning:require_once(/var/www/html/wp-config.php):failedtoopenstream:Permissiondeniedin/var/www/html/wp-load.phponline37[SunJan1522:42:54.44

php - file_put_contents(.../bootstrap/cache/services.json) : failed to open stream: No such file or directory

我在运行任何phpartisan命令时一直收到此错误。[ErrorException]file_put_contents(/Applications/MAMP/htdocs/code/bheng/md-bheng/bootstrap/cache/services.json):failedtoopenstream:Nosuchfileordirectory我该如何阻止它? 最佳答案 编辑-如果services.json文件不存在,运行phpartisanserve然后停止强制创建文件。请参阅:laravelservices.jsonn

php - 使用 Graph API 通过 PHP 发布到 Facebook Stream

我正在尝试使用新的图形API和PHP将消息发布到用户的墙上。连接似乎工作正常,但没有出现任何帖子。我不确定如何正确设置发布代码。请帮帮我。抱歉,看起来很糟糕的代码,出于某种原因,StackOverflow不想在代码块中将其全部关闭。下面是我的完整代码。我是否缺少扩展程序权限请求,或者是否在这段代码中得到了注意:PHP代码'xxxxxxxxxxxxxxxxxx','secret'=>'xxxxxxxxxxxxxxxxxxxxxxxxxx','cookie'=>true));$session=$facebook->getSession();if(!$session){$url=$faceb

php - PHP5 服务器的带宽提速技巧 : Output and Zlib Compression

在设置PHP带宽节省和体验到的有效速度增益时,我有一些关于htaccess中设置的性质的详细、专业的问题:请允许我提前感谢您对此事的回答和澄清,因为我不理解百科全书式的长页apache手册下面的例子是在我的Apache2.0和PHP5.2.3上实际运行的#preservebandwidthforPHPenabledserversphp_valuezlib.output_compression16386.Q1:ifmodulemod_php4.c是否表明它适用于PHP4而不是PHP5?Q2:服务器引擎在php.ini而不是htaccess中有这个会更快吗?Q3:压缩默认设置为16386。

php - stream_socket_client 通过 http 代理

我正在研究APNS(Apple推送通知服务)。我正在按照教程所说的那样做:$ctx=stream_context_create();stream_context_set_option($ctx,'ssl','local_cert','ck.pem');stream_context_set_option($ctx,'ssl','passphrase',$passphrase);$fp=stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195',$err,$errstr,60,STREAM_CLIENT_CONNECT|