所有由54xiake发布的文章
[php]关闭php版本信息X-Powered-By
查看网页header信息,可以看到PHP的版本,为了安全起见,我们可以关闭这个PHP版本的信息(X-Powered-By)
curl –head “http://blog.54xiake.cn”
HTTP/1.1 200 OK
Server: nginx/1.1.5
Date: Sat, 10 Jun 2017 05:09:36 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.5.29
X-Pingback: http://blog.54xiake.cn/xmlrpc.php
php.ini中搜索expose_php,默认为On
修改为expose_php = Off
[php]windows上启动两个apache,两个版本php
原理:安装两个apache服务,对应不同的配置文件(http.conf),加载不同的php模块,启用两个不同端口。
apache版本:apache2.4.10
php版本:php5.5.18/php7.1.5
两个httpd.conf配置文件差异部分
httpd.conf
Listen 80
PHPIniDir “F:/SERVER/php5.5.18”
LoadFile “F:/SERVER/php5.5.18/libpq.dll”
LoadFile “F:/SERVER/php5.5.18/libpq.dll”
LoadFile “F:/SERVER/php5.5.18/libeay32.dll”
LoadFile “F:/SERVER/php5.5.18/ssleay32.dll”
LoadModule php5_module “F:/SERVER/php5.5.18/php5apache2_4.dll”
httpd-php7.conf
Listen 81
PHPIniDir “F:/SERVER/php7.1.5”
LoadFile “F:/SERVER/php7.1.5/libpq.dll”
LoadFile “F:/SERVER/php7.1.5/libpq.dll”
LoadFile “F:/SERVER/php7.1.5/libeay32.dll”
LoadFile “F:/SERVER/php7.1.5/ssleay32.dll”
LoadModule php7_module “F:/SERVER/php7.1.5/php7apache2_4.dll”
两个php.ini配置文件差异部分
php5.5.18中php.ini文件
extension_dir = “F:\SERVER\php5.5.18\ext\”
php7.1.5中php.ini文件
extension_dir = “F:\SERVER\php7.1.5\ext”
将需要的扩展打开
extension=php_gd2.dll
extension=php_openssl.dll
extension=php_pdo_mysql.dll
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll
extension=php_soap.dll
服务安装
F:\SERVER\apache2.4.10\bin\httpd.exe -k install -n Apache2.4 -f “F:\SERVER\apache2.4.10\conf\httpd.conf”
F:\SERVER\apache2.4.10\bin\httpd.exe -k install -n Apache2.4-Php7 -f “F:\SERVER\apache2.4.10\conf\httpd-php7.conf”
启动服务即可
net start Apache2.4
net start Apache2.4-Php7
访问
http://localhost
查看server
Server:Apache/2.4.10 (Win64) OpenSSL/1.0.2k PHP/5.5.18
http://localhost:80
查看server
Server:Apache/2.4.10 (Win64) OpenSSL/1.0.2k PHP/7.1.5
[laravel]怎么禁止laravel自动转义HTML标签?
问题:使用ueditor显示数据库中存取的html数据,出现html被转义
解决方法:
Blade输出的时候,使用下面的方式
<script type="text/javascript"> var ue = UE.getEditor('container'); ue.ready(function() { ue.execCommand('serverparam', '_token', '{{ csrf_token() }}'); ue.setContent("{!!$content!!}");//{{$content}}这样会被转义 }); </script>
这样输出的是没有转义的值。
[centos7]yum安装所需软件
个人习惯:公共软件采用yum安装,其他服务(nginx、php、mysql等)采用自己编译安装!
[centos7]关闭默认防火墙启用iptables防火墙
[centos7]网络配置及开机启动
#!/bin/bash ifconfig ens33 192.168.1.122 netmask 255.255.255.0 ifconfig ens33 up | down //激活,关闭设备ens33 route add default gw 192.168.1.1
5120 recv() failed (104: Connection reset by peer) while reading response
问题:
图片不显示,nginx报错如下:
[error] 28585#0: *5120 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 124.127.211.125, server: www.54xiake.cn, request: “GET /admin/index.php?act=captcha&2027168701 HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “www.54xiake.cn”
查看
Nov 02 23:50:15.324126 [WARNING] fpm_stdio_child_said(), line 167: child 10866 (pool default) said into stderr: “libpng warning: Application was compiled with png.h from libpng-1.5.12”
Nov 02 23:50:15.324325 [WARNING] fpm_stdio_child_said(), line 167: child 10866 (pool default) said into stderr: “”
Nov 02 23:50:15.324411 [WARNING] fpm_stdio_child_said(), line 167: child 10866 (pool default) said into stderr: “libpng warning: Application is running with png.c from libpng-1.2.49”
Nov 02 23:50:15.324490 [WARNING] fpm_stdio_child_said(), line 167: child 10866 (pool default) said into stderr: “”
Nov 02 23:50:15.324582 [WARNING] fpm_stdio_child_said(), line 167: child 10866 (pool default) said into stderr: “gd-png: fatal libpng error: Incompatible libpng version in application and library”
Nov 02 23:50:16.061598 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Nov 02 23:50:16.061754 [WARNING] fpm_children_bury(), line 215: child 10866 (pool default) exited on signal 11 SIGSEGV (core dumped) after 113.343143 seconds from start
Nov 02 23:50:16.062287 [NOTICE] fpm_children_make(), line 352: child 11306 (pool default) started
解决:
rpm -e –nodeps libpng-devel-1.2.49-1.el6_2.x86_64
rpm -e –nodeps libpng-1.2.49-1.el6_2.x86_64
JetBrains PhpStorm 8注册码一枚
jQuery插件实现瀑布留布局masonry + infinitescroll 图片高度处理
jQuery插件实现瀑布留布局masonry + infinitescroll 。 使用官方的示例代码实际测试发现,当上传到服务器的时候,由于图片下载速度问题,导致图片高度不能被正确识别,从而造成层的重叠。 解决方法就是使用imagesLoaded加载。
var $container = $('#flow'); $('#flow').imagesLoaded(function(){ $('#flow').masonry({ itemSelector: '.box', gutterWidth: 20, columnWidth: 238 }); });
这样解决了第一次加载时候的问题,但是当异步请求之后加载的图片仍然无法正确的获取高度,解决的办法就是先将下载的图片隐藏,等图片下载完毕后再使用masonry渲染。代码如下:
$('#flow').infinitescroll({ loading : { msgText : &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;em&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;正在加载&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/em&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;, img: &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;http://www.infinite-scroll.com/loading.gif&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;, finishedMsg : &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;em&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;木有了哦...&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/em&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot; }, navSelector : &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;#plist&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;, nextSelector: &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;#plist a&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;, itemSelector: &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;.box&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;, pixelsFromNavToBottom: 100, animate: true },function(newElements) { //先隐藏 var $newElems = $( newElements ).css({ opacity: 0 }); $newElems.imagesLoaded(function(){ //图片显示后再进行masonry渲染 $newElems.animate({ opacity: 1 }); $container.masonry( 'appended', $newElems, true ); }); });
这样就很好的解决了图片加载的问题。