PHP

PHP如何调用python

php代码<?php#header("Content-type:text/html;charset=utf-8");//echo'helloworld';$output=shell_exec('pythontest.py');$array=explode(',',$output);echo$array[0];fo...
开发笔记·2020-03-09

scandir() symlink() has been disabled for security reasons解决方法

找到php.ini,ctrl+F搜索“disable_functions”  将“disable_functions”中的scandir、symlink删除,并保存php.ini文件,重启服务,刷新页面。即可解决报错问题。...

PHP强制输出错误信息

 1.修改php.ini    ;显示错误信息display_errors=On;显示php开始错误信息display_startup_errors=On;日志记录错误信息log_errors=On 2.PHP文件输出ini_set('display_erro...

php类中使用未定义的属性说明

一般情况下,在类中要使用一个属性,最好是先申明这个属性。否则就是给自己的挖坑了。先来看以下一段代码,<?phpclasstest_class{publicfunctionout(){$this->test=8;return$this->test;}}$obj=newtest_class();echo$...

swoole文件上传代码

<?php$http=newswoole_http_Server("0.0.0.0",9501);$http->on('request',function($request,$response)use($http){if($request->server['request_method']!='GET...
开发笔记·2020-03-08

ailed to open stream:Permission denied in 错误的解决方法

1,问题:用php在做项目的时候,偶尔会出现failedtoopenstream:Permissiondeniedin这个错误,原因是因为某个没有某个文件的血的权限,所以在写入文件的时候会报错2,解决方案:点击该文件,右击,点击属性,会看到该文件的所有属性,点击安全,即可设置所有组的用户权限,点击写入即可有写入权限&n...

php输出utf-8格式

header("Content-type:text/html;charset=utf-8"); ...
开发笔记·2020-03-05

PHP实现m3u8并发下载

直接上代码<?php//php下载m3u8文件$url=$argv['1'];if(!file_exists('./tmp/')){if(!mkdir('./tmp/')){die('请手动在当前目录创建tmp目录');}}$indexPage=file_get_contents($url);preg_match...