php关于ob_gzhandler和gzencode()

2019-10-22 Stone PHP

前一段时间要搞一个gzip压缩输出,想着在文件里用ob_start('gz_handler');结果客户端始终打不开。

改成gzencode($data, 5); 之后能正常打开。


ob_gzhandler在ob_start中使用的用来压缩输出缓冲区中内容的回调函数。


gzencode创建gzip压缩字符串


gzencode ( string $data [, int $level = -1 [, int $encoding_mode = FORCE_GZIP ]] )


This function returns a compressed version of the input data compatible with the output of the gzip program.

标签: php压缩输出

评论(0) 浏览(1069)

virtualBox报错 0x80004005

2019-10-12 Stone 运维

virtualBox升级之后,无法开机出现错误,错误提示:

返回 代码:  E_FAIL (0x80004005) 
组件:  MachineWrap 
界面:  IMachine {5047460a-265d-4538-b23e-ddba5fb84976} 

然后就是各种百度搜索,给出的答案也是五花八门,然后各种试,始终是报错。

然后把virtualBox还原到原来的版本,仍然出错,最后把virtualBox版本降到4.1.3,安装完成之后就能正常启动了。


参考链接:http://freewisdoms.com/how-to-fix-0x80004005-error-virtualbox-unable-to-start-virtual-machine/


标签: virtualBox报错 0x80004005

评论(0) 浏览(1374)

Apache 报错: couldn't perform authentication. AuthType not set!: /

2019-10-11 Stone 运维

使用 Apache 的虚拟机服务,出现 500 internal error。查看 error_log,看到如下报错内容:

[Fri Oct 11 00:17:46 2019] [crit] [client 124.64.30.156] configuration error:  couldn't perform authentication. AuthType not set!:

然后httpd.conf中的代码:

<VirtualHost *:80>
    DocumentRoot "/htdocs/tu/web"
    ServerName localhost:80

    ErrorLog logs/www.tu.com.error.log
    CustomLog logs/www.tu.com.access.log common

    <Directory "/htdocs/tu/web">
       Options Indexes FollowSymLinks ExecCGI
       AllowOverride all
       allow from all  
       Require all granted
    </Directory>
</VirtualHost>

百度一下,说是发现 “Require all granted” 指令只能用于 Apache 2.4,现在用的是Apache 2.2,。

只需要将 Require all granted 替换一下:

Order allow,deny
Allow from all

标签: apache报错

评论(0) 浏览(1096)

git 回滚代码到某个commit

2019-10-9 Stone 运维

1、查看commit日志
	git log
2、git回滚代码

回退到上个版本:git reset --hard HEAD^
回退到前3次提交之前,以此类推,回退到n次提交之前:
git reset --hard HEAD~3

回滚到指定commit的sha码
git reset --hard commit_id


标签: git回滚

评论(0) 浏览(1138)

Copyright © 2019 by 海角孤星 京ICP备15056837号-1