- 博客(16)
- 资源 (1)
- 收藏
- 关注
原创 chown: changing ownership of /vagrant: Not a directory
找到version_5_0.rb 搜索 if Vagrant::Util::Platform.windows? 注释掉以下行# if Vagrant::Util::Platform.windows?# hostpath = Vagrant::Util::Platform.windows_unc_path(hostpath) # end...
2018-09-21 17:41:15 796
原创 vagrant的安装和使用
安装和配置 ## 2.1: 第一次使用,没有vagrant环境- 下载并安装[oracle-vm](http://download.virtualbox.org/virtualbox/5.0.0/VirtualBox-5.0.0-101573-Win.exe)- 配置oracle vm环境变量,vagrant会在全局变量中调用oracle vm启动命令- 下载并安装[vagr...
2018-09-21 17:40:38 538
原创 VirtualBox 更改虚拟磁盘大小
@停止虚拟机 #vagrant halt @转换为vdi #从Virtualbox页面查看硬盘文件地址(选中虚拟机->右键->设置->存储) #cmd命令VBoxManage clonehd "box-disk1.vmdk" "box-disk1.vdi" --format vdi @给vdi格式硬盘文件扩容 #VBoxMa...
2018-09-21 17:36:43 3717
原创 Python的虚拟环境Virtualenv
@什么是Virtualenv #virtualenv通过创建独立Python开发环境的工具, 来解决依赖、版本以及间接权限问题。 @安装Virtualenv #pip install virtualenv @使用Virtualenv #创建项目目录 #virtualenv env #virtualenv --system-site-...
2018-09-21 17:33:15 150
原创 php 生成Excel文件
文件头部: header('Cache-Control:no-cache, must-revalidate'); header('Content-type:application/vnd.ms-excel'); header("Content-Disposition:attachment;filename=".$_GET['fname'].".xls"); ...
2018-09-21 17:29:08 1343
转载 php rgb 转 hsv
<?phpfunction RGB_TO_HSV ($R, $G, $B) // RGB Values:Number 0-255{ // HSV Results:Number 0-1 $HSL = array(); $var_R = ($R / 255); $var_G = ($G / 255...
2018-09-20 15:40:27 499
转载 PHP PHP_EOL 换行符
换行符unix系列用 \nwindows系列用 \r\nmac用 \rPHP中可以用PHP_EOL来替代,以提高代码的源代码级可移植性 如: <?php echoPHP_EOL; //windows平台相当于 echo "\r\n"; //unix\linux平台相当于 echo "\n"; //mac平...
2018-09-20 15:28:08 380
转载 php用&&和||缩写条件语句
看下面的这种写法:<?php!$var && $var = ‘你好!’;$error or die(‘Error!’);?>&& 为 同时真 运算符.A && B, 只有当A 和 B 都为真的时候,这句才是真PHP会先判断A是否为真, 若A为真的话 就会继续判断B.所以,当A为真, B是一个语句的时候, ...
2018-09-20 15:25:46 368
原创 tiff图片转jpg
function tiff2jpg($file,$newname) { $mgck_wnd = NewMagickWand(); MagickReadImage($mgck_wnd, $file); $img_colspc = MagickGetImageColorspace($mgck_wnd); //if ($img_colspc == MW_CMY...
2018-09-20 15:24:11 2524
转载 PHP把png转成透明png
function createPng($png, $basepng){ $picture = imagecreatefrompng($png); $img_w = imagesx($picture); $img_h = imagesy($picture); $newPicture = imagecreatetruecolor( $img_w, $img_h );...
2018-09-20 14:52:00 650
原创 PHP设置cookie无效问题原因以及解决方案
在某个页面中使用setcookie来设置cookie,例如setcookie("id",$id, time()+36002430);但是回到首页之后发现没有生效,用javascript:alert(document.cookie)里面为空,PHP里面的$_COOKIE也是没有数据。跑到PHP官网查看setcookie的说明,官网的例子也是这样的,但是仔细看来参数说明之后就发现问题了。...
2018-09-20 14:49:29 11979
原创 php获取ip之后ip2long存在mysql中发现都是2147483647
发现一个很有意思的bug,在Yii2中获取ip之后入库,发现库中好多都是2147483647。原来是存ip的字段没设无符号。
2018-09-20 14:46:36 623
原创 Composer
@什么是Composer #是一个PHP程序依赖管理工具(管理包和库),受到node npm和ruby的启发 @PHP版本要求 #PHP 5.3.2+以上版本 @windows下安装 #开启openssl拓展 #下载CA证书,下载地址:http://curl.haxx.se/docs/caextract.html 存到本地D:\phpStu...
2018-09-20 14:44:51 84
原创 PHPStrom在PHPStudy的环境下运行xDeBug断点调试
@开启phpstudy的xdebug @配置php.ini xdebug.profiler_append = 0 xdebug.profiler_enable = 1 xdebug.profiler_enable_trigger = 0 xdebug.profiler_output_dir="D:\phpStudy\PHPTutorial\tmp\x...
2018-09-20 14:42:41 615
原创 PHP链式操作的实现
@三种实现方法 #魔法函数__call结合call_user_func来实现 #使用魔法函数__call结合call_user_func_array来实现 #return $this; @使用魔法函数__call结合call_user_func来实现<?php class StringHelper { priva...
2018-09-19 17:25:48 178
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人