首页
Search
1
解决 docker run 报错 oci runtime error
49,385 阅读
2
WebStorm2025最新激活码
27,669 阅读
3
互点群、互助群、微信互助群
22,785 阅读
4
常用正则表达式
21,570 阅读
5
罗技鼠标logic g102驱动程序lghub_installer百度云下载windows LIGHTSYNC
19,475 阅读
自习室
CODER
课程
SEO
学习视频
手册资料
呆萌
工具软件
运维
DBA
互通有无
资源
微信群
激活工具
搞钱日记
养生记
包罗万象
Search
标签搜索
DeepSeek
学习指北
Prompt
提示词
Loong
累计撰写
182
篇文章
累计收到
0
条评论
首页
栏目
自习室
CODER
课程
SEO
学习视频
手册资料
呆萌
工具软件
运维
DBA
互通有无
资源
微信群
激活工具
搞钱日记
养生记
包罗万象
页面
搜索到
182
篇与
的结果
2019-07-30
Docker从入门到实践
提取码:idku
2019年07月30日
5,862 阅读
0 评论
0 点赞
2019-07-26
nginx 通过外网服务器泛域名配置映射到内网端口或者泛地址
nginx 通过外网服务器泛域名配置映射到内网端口或者泛地址。配置示例如下:server { listen 80; server_name *.i.weitip.com; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/weitip.com/frps; location / { # 泛域名开始配置 if ( $host ~* (.*)\.(.*)\.(.*)\.(.*) ) { set $domain $1; #获取当前的 域名前缀 } resolver 114.114.114.114; set $url "http://$domain.weitip.com:8080"; proxy_pass $url; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } access_log /www/wwwlogs/frps.weitip.com.log; error_log /www/wwwlogs/frps.weitip.com.error.log; }
2019年07月26日
4,945 阅读
0 评论
32 点赞
2019-07-17
阿里巴巴开源镜像提供的 packagist 镜像服务 阿里云 Composer 全量镜像
全局配置(推荐)所有项目都会使用该镜像地址:composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/取消配置:composer config -g --unset repos.packagist项目配置仅修改当前工程配置,仅当前工程可使用该镜像地址:composer config repo.packagist composer https://mirrors.aliyun.com/composer/取消配置:composer config --unset repos.packagist调试composer 命令增加 -vvv 可输出详细的信息,命令如下:composer -vvv require alibabacloud/sdk
2019年07月17日
5,031 阅读
0 评论
10 点赞
2019-07-10
Windows下搭建虚拟机和Laravel开发环境配置VirtualBox+Vagrant+Homestead
方法一:前提条件:Windows 用户,你可能需要启用硬件虚拟化(VT-x)。这通常需要通过 BIOS 来启用它。如果你在一个 UEFI 系统上使用的是 Hyper-V,你需要关闭 Hyper-V 才能启用 VT-x下载安装最新版: VirtualBox 和 Vagrant1·首先将Homestead文件夹放入到当前用户目录之下2·然后 使用git命令工具3·cd 切换到Homestead目录下4·将virtualbox.box离线文件放入指定目录上5·执行 vagrant box add laravel/homestead 加上离线文件的路径virtualbox.box进行安装6·初始化:bash init.sh7·安装好之后打开Homestead文件夹打开Homestead.yaml文件进行修改配置:ip: “192.168.10.10”memory: 2048cpus: 3provider: virtualboxauthorize: ~/.ssh/id_rsa.pubkeys:– ~/.ssh/id_rsafolders:– map: F:/htdocs/Laravelto: /home/vagrant/Code/Laravelsites:– map: laravel.appto: /home/vagrant/Code/Laravel/publicdatabases:– homestead8·保存之后,加入hosts文件配置:192.168.10.10 laravel.app9·生成密钥:ssh-keygen10·vagrant up开启虚拟机11·vagrant ssh 进入到虚拟机系统上关闭虚拟机:vagrant halt查看vagrant常用命令:vagrant 方法二:1·你首先要确定你有个好的 terminal [ 终端:cmder 或 Git 的git bash ] . 注意windows的cmd不能用(个人推荐用Git bash)2·下载和安装 [ virtualbox ] 和 [ vagrant ]前者为系统装载用的,后者为系统控制用的3·如果你要使用 homestead 就必须要有个virtualbox.box的文件 ,官方 Laravel 下载这个文件的这个命令为vagrant box add laravel/homestead 但是因为中国的对外国网络资源的限制,你要下载这个文件可能会需要不少的时间,因此 , 在这我们拥有两个选择的余地选择一 : 当你使用官方下载命令时,你的终端会显示这个文件的源地址复制https://atlas.hashicorp.com/laravel/boxes/homestead/,然后按 ctrl +c 退出,然后用的喜欢的下载软件下载,最好是用最新版的,因为会有各种问题.选择二 : phphub上的 virtualbox.box好了 , 现在我假设你已经拥有这个文件,现在来用我们的方法添加 virtualbox.box . 打开你的ide(代码编译器) ,一般为 Sublime Text 和 Atom ,为何要提编译器呢 , 因为下面的步骤可能会需要其中一个的编译器 , 创建一个名为homestead.json的文件 , 输入以下内容{“name”: “laravel/homestead”,“versions”:[{“version”: “1.0.1”,“providers”: [{“name”: “virtualbox”,“url”: “D:/box/virtualbox.box” //你下载的virtualbox.box在电脑系统上的位置}]}]}打开的 IDE (编译器) 先不要保存,点击开始菜单或 win 快捷键 , 在搜索栏处输入你的terminal ( 终端 ) , 点击鼠标右键以管理员身份运行,一般会跳转到 : C:\Users\windows的账户名>然后回到 IDE (编译器) 保文件到C:\Users\windows的账户名这个目录下 , 并且命名为 homestead.json , 然后再回到terminal ( 终端 ) 输入一下代码 :C:\Users\windows的账户名> vagrant box add homestead.json C:\Users\windows的账户名> vagrant box add homestead.json==> box: Loading metadata for box 'homestead.json'box: URL: file://C:/Users/windows的账户名/homestead.json==> box: Adding box 'laravel/homestead' (v1.0.1) for provider: virtualboxbox: Downloading: "D:/box/virtualbox.box" //你下载的virtualbox.box在电脑上的位置box: Progress: 100% (Rate: 129M/s, Estimated time remaining: --:--:--)==> box: Successfully added box 'laravel/homestead' (v1.0.1) for 'virtualbox'!然后继续 在terminal ( 终端 ) 输入.C:\Users\windows的账户名> ssh-keygen -t rsa -C "
[email protected]
"说明 : 这个命令是创建 Homestead 连接秘匙 , 因为我们是在本机上运行的所以不需要密码之类的 , 一直按回车就行C:\Users\windows的账户名> ssh-keygen -t rsa -C "
[email protected]
"Generating public/private rsa key pair.Enter file in which to save the key (/c/Users/windows的账户名/.ssh/id_rsa):Created directory '/c/Users/windows的账户名/.ssh'.Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /c/Users/windows的账户名/.ssh/id_rsa.Your public key has been saved in /c/Users/windows的账户名/.ssh/id_rsa.pub.The key fingerprint is:SHA256:UTmPEezFQK0XUa5Km2lGnqOBgtCo5rwGGWCX8CaTN6g
[email protected]
key's randomart image is:+---[RSA 2048]----+| .. . o=*.o. ||..+o .= =. ||o=.= .. B .. ||oo= . .+ o. ||Eo. S o.. ||+. . . + * ||o.. . . . @ ||+. . = . ||.+. . |+----[SHA256]-----+5·现在继续 在terminal ( 终端 ) 输入.git clone https://github.com/laravel/homestead.git Homestead说明 : 这个命令是 下载 Homestead 目录,里面包含了Homestead 的配置文件C:\Users\windows的账户名> git clone https://github.com/laravel/homestead.git HomesteadCloning into 'Homestead'...remote: Counting objects: 1623, done.rRemote: Total 1623 (delta 0)eceiving objects: 99% (1, reused 0 (delt607/1623), 244a 0), pack-reuse.01 KiB | 13.00d 1623 KiB/sReceiving objects: 100% (1623/1623), 252.22 KiB | 13.00 KiB/s, done.Resolving deltas: 100% (958/958), done.Checking connectivity... done.现在让我们来看看文件是否现在成功了,在 在terminal ( 终端 ) 输入 : C:\Users\windows的账户名> lsHomestead/ //我其他文件夹就没写了,只要看到了这个文件夹你就算是把 Homestead 的配置文件下载下来了然后继续 在terminal ( 终端 ) 输入 C:\Users\windows的账户名 > cd HomesteadC:\Users\windows的账户名\Homestead >C:\Users\windows的账户名\Homestead > bash init.sh //初始化 .homestead 目录说明 : 这个bash init.sh 命令会创建一个 .homestead目录这个目录位于C:\Users\windows的账户名\ 这个目录下这个.homestead目录里有一个 Homestead.yaml 文件很多人windows启动Homestead失败都是因为这个配置文件的关系6·注意 !!!现在这个步骤很重要好了现在用 IDE(代码编译器) 打开目录地址 C:\Users\windows的账户名\ .homestead\Homestead.yaml , 你会看到如下代码|---| ip: "192.168.10.10"|memory: 2048|cpus: 1|provider: virtualbox||authorize: ~/.ssh/id_rsa.pub||keys:| - ~/.ssh/id_rsa||folders:| - map: ~/Code //这个是你的项目的地址,例如D:\随便\项目的目录 1| to: /home/vagrant/Code //这个是homestead系统的地址 2| //其实这就是windows和hometead两个系统共享一个文件夹,难懂一点的话叫||映射||sites: //__这个是你的项目| - map: homestead.app 这个是你项目要设定在你的浏览器上的地址 //需要设定C host文件| to: /home/vagrant/Code/Laravel/public //这里的Laravel其实就是D:\随便\项目的目录\Laravel||databases:| - homestead||# blackfire:|# - id: foo|# token: bar|# client-id: foo|# client-token: bar||# ports:|# - send: 50000|# to: 5000|# - send: 7777|# to: 777|# protocol: udp将以上的代码修改成以下的代码|—|ip: “192.168.10.10”|memory: 2048|cpus: 1|provider: virtualbox||authorize: ~/.ssh/id_rsa.pub||keys:| – ~/.ssh/id_rsa||folders:| – map: D:\随便\项目的目录 //当启动时会自动转换成D:/随便/项目的目录,这个是正确的| to: /home/vagrant/Code||sites: //看到这你可以看到为什么是sites,而不是site| – map: aimiliya.local 这个是你在hosts设定的网站地址| to: /home/vagrant/Code/king/public 这里的king是你设定的D:\随便\项目的目录\king|| – map: lamu.local| to: /home/vagrant/Code/lamu/public|| – map: leimu.local| to: /home/vagrant/Code/leimu/public|||databases:| – homestead||# blackfire:|# – id: foo|# token: bar|# client-id: foo|# client-token: bar||# ports:|# – send: 50000|# to: 5000|# – send: 7777|# to: 777|# protocol: udp|提醒 : IDE(代码编译器) 记得保存 .警告 : 以上代码为最基础的Homestead配置 ,你要进行开启其他功能最好阅读或参考 Laravel 和 vagrant官方文档举例 : 例如在 folders 下面填写 type:“nfs” , 这对于windows 来说是错误的 , 对于 mac 来说却是成功的 , 原因vagrant不支持对 windows 开启 nfs ,具体参考 synced-folders .7 .好了现在回到 terminal ( 终端 ) 启动吧,输入 vagrant up注意 : 在你以后重新启动Homestead .即 : vagrant up都必须在 Homestead 这个目录下启动C:\Users\windows的账户名\Homestead> vagrant upBringing machine 'default' up with 'virtualbox' provider...==> default: Checking if box 'laravel/homestead' is up to date...==> default: Clearing any previously set forwarded ports...==> default: Clearing any previously set network interfaces...==> default: Preparing network interfaces based on configuration...default: Adapter 1: natdefault: Adapter 2: hostonly==> default: Forwarding ports...default: 80 (guest) => 8000 (host) (adapter 1)default: 443 (guest) => 44300 (host) (adapter 1)default: 3306 (guest) => 33060 (host) (adapter 1)default: 5432 (guest) => 54320 (host) (adapter 1)default: 22 (guest) => 2222 (host) (adapter 1)==> default: Running 'pre-boot' VM customizations...==> default: Booting VM...==> default: Waiting for machine to boot. This may take a few minutes...default: SSH address: 127.0.0.1:2222default: SSH username: vagrantdefault: SSH auth method: private key==> default: Machine booted and ready!==> default: Checking for guest additions in VM...default: The guest additions on this VM do not match the installed version ofdefault: VirtualBox! In most cases this is fine, but in rare cases it candefault: prevent things such as shared folders from working properly. If you seedefault: shared folder errors, please make sure the guest additions within thedefault: virtual machine match the version of VirtualBox you have installed ondefault: your host and reload your VM.default:default: Guest Additions Version: 5.0.20default: VirtualBox Version: 5.1==> default: Setting hostname...==> default: Configuring and enabling network interfaces...==> default: Mounting shared folders...default: /vagrant =>C:/Users/windows的账户名/Homesteaddefault: /home/vagrant/Code => D:/随便/项目的目录 //当你没看到这条信息请返回你的Homestead.yaml设定==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`==> default: flag to force provisioning. Provisioners marked to run always will still run.好了,这算启动成功了,但是配置成功了吗?还不能确定的,输入 vagrant ssh 登入homesteadC:\Users\windows的账户名\Homestead> vagrant sshWelcome to Ubuntu 16.04 LTS (GNU/Linux 4.4.0-22-generic x86_64)*Documentation: https://help.ubuntu.com/vagrant@homestead:~$ //当看到这个说明登入成功了vagrant@homestead:~$ ls //查看下一级目录 ,有Code,可以安心Codevagrant@homestead:~$ cd Codevagrant@homestead:~/Code$ ls //当看到king了,你可以彻底放心了,配置成功了king提醒 :如果你启动了 Homestead , 你发觉你的配置文件 Homestead.yaml :想要修改 , 可以的使用命令:vagrant up –provision ,此命令必须在Homestead 启动后使用,此命令作用为更新Homestead.yaml的修改8·最后要在浏览器上显示你的网页你必须设定对应的hosts .hosts文件所在在目录:C:\Windows\System32\drivers\etc\hosts 先hosts拖到桌面,然后修改成:|# Copyright (c) 1993-2009 Microsoft Corp.|#|# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.|#|# This file contains the mappings of IP addresses to host names. Each|# entry should be kept on an individual line. The IP address should|# be placed in the first column followed by the corresponding host name.|# The IP address and the host name should be separated by at least one|# space.|#|# Additionally, comments (such as these) may be inserted on individual|# lines or following the machine name denoted by a ‘#’ symbol.|#|# For example:|#|# 102.54.94.97 rhino.acme.com # source server|# 38.25.63.10 x.acme.com # x client host||# localhost name resolution is handled within DNS itself.|# 127.0.0.1 localhost|# ::1 localhost||192.168.10.10 aimiliya.local|192.168.10.10 lamu.local|192.168.10.10 leimu.local然后把刚复制到桌面而且修改好的hosts文件的拖回C:\Windows\System32\drivers\etc\hosts覆盖.注意:直接修改是不行的
2019年07月10日
4,510 阅读
0 评论
1 点赞
2019-07-10
PHP经典面试题汇总(六)
六十一·写出一个函数实现字符串翻转?方法一:strrev();方法二:$str = "abcdefg"; function show($str){ for ($i=strlen($str); $i>= 0; $i--) { $str2 .= $str{$i}; } return $str2; } echo @show($str);六十二.在hello.txt文件前面追加字符串,往前面写数据?$str = "h1\n"; $file = 'hello.txt'; $get = file_get_contents($file); file_put_contents($file,$str .=$get);六十三.判断用户ip地址是否在192.168.1.100~192.168.1.150范围内?方法一:$ip = "192.167.1.110"; $x = ip2long($ip); $ip1 = "192.168.1.100"; $min = ip2long($ip1); $ip2 = "192.168.1.150"; $max = ip2long($ip2); if($x > $max || $x < $min){ exit("ip不在范围内"); } echo "ip符合要求";方法二:$ip = "192.168.1.120"; echo $pos = strrpos($ip,'.')+1; $ipleft = substr($ip,0,$pos); $ipright = substr($ip,$pos); if($ipleft != "192.168.1."){ exit("ip不在范围内"); } if($ipright >150 || $ipright <100){ exit("ip不在范围内"); } echo "ip符合要求";六十四·请将2维数组按组 name的长度进行重新排序,按照顺序将id赋值(从1开始)?$arr = array( array('id' => 0,'name' => '323444'), array('id' => 0,"name" => 'sgegesssssg'), array('id' => 0,'name' => '这是字符串'), array('id' => 0,'name' => '101928ss323sssgee323'), array('id' => 0,'name' => 'slkgjeoge'), array('id' => 0,'name' => '32'), array('id' => 0,'name' => '1019283'), ); foreach ($arr as $val) { $long[] = strlen($val['name']); } array_multisort($long,$arr); foreach ($arr as $key => &$val) { $val['id'] = $key+1; } echo "
2019年07月10日
6,289 阅读
0 评论
3 点赞
1
...
26
27
28
...
37