ThinkPHP使用CDN加速不显示图片
如果你在用thinkPHP做东西,并且又用到了七牛之类的CDN加速方案,那么你应该会碰到这种情况: 当你在一个文章上传了一张图片,图片能正常显示到前端页面,当你在另一个文章又上传了同一张图片,这个时候当前文章的图片能正常显示,可是之前的那文章的图片却不见了。这是怎么加速呢? 其实是因为thinkPHP对图片有指纹验证功能,同样的图片不会二次上传,这其中的指纹识别是记录到数据库中的。当系统通过这种技术检测到图片已经存在的时候,会进一步判断图片实际文件是否真实存在,如果不存在就把数据库里面当前图片记录删除。 那么问题来了,当你上传图片是存到CDN服务器上的,本地...标签: php
[linux]Create multi virtual host in apache
In http.conf or its sub config file: Must define like this: NameVirtualHost *:443 <VirtualHost *:443> DocumentRoot "/alidata/www/log" ServerName log.anycle.com:443 ServerAdmin you@example.com ErrorLog "/alidata/server/httpd/logs/error_log" TransferLog "/alidata/server/ht...标签: linux
[linux]Install mod_ssl.so in apache without rebuild apache
1.Find my source code and apxs: ~$locate apxs /alidata/server/httpd-2.2.29/bin/apxs ... /home/tmp/sh-1.4.1/httpd-2.2.29/ 2.Enter the ssl directory of source code: cd /home/tmp/sh-1.4.1/httpd-2.2.29/modules/ssl 3.Run apxs: /alidata/server/httpd-2.2.29/bin/apxs -i -c -a -D HAVE_OPENSSL=1 -...标签: linux
一种抓取网络图片保存至网站的方法
突然想到一种抓取网络图片保存至网站的方法: 首先提交网络图片url到服务器,服务器调用curl方法将图片保存,并生成图片地址,返回图片地址给前端, 这样一来,前端看上去就是将网络图片转成了自己的图片了。[c]linux下构建lib库
来来来,新技能,linux下构建lib库的步骤: 1、准备库函数源文件; my_add.c int add(int a, int b){ printf("Here is my_add.c\n"); return a+b; } my_sub.c int sub(int a, int b){ printf("Here is my_sub.c \n"); return a-b; } 2、生成目标文件; gcc -c my_add.c...[C++]从电子地图网站把电子地图生成到本地的程序
前面写了《批量下载网络图片到本地》及《将多张图片合并成大图》,所以综合一下,完整的从电子地图网站把电子地图生成到本地的程序: #include <vector> #include <urlmon.h> #include <string> #include <iostream> #include "loadpng.h" using namespace std; #pragma comment(lib, "urlmon.lib") #define ROW 12 #define COL 9 #define PI...标签: C++
[C++]将多张图片合并成大图
在《批量下载网络图片到本地》里写到了批量下载图片,其实那些图片是电子地图的散片,我想把这些图片合成一张大图,以便做成可以直接打开查看的地图甚至把印成纸质地图。当然这一切可以用图片处理软件一张一张地拼接,但地图散片动不动就是成百上千片,手动处理会很累,于是我选择了C++,代码很简单,同时这也得益于lodepng库的引入: #include <vector> #include <urlmon.h> #include <string> #include <iostream> #include "loadpng.h" usi...标签: C++
[C++]批量下载网络图片到本地
最近看上了一个地图,在网上有电子版的,但是电子地图是由一小块一小块图片组成了,我想把他们下载到电脑上,图片太多,又不想一个地址一个地址地复制,怎么办?于是,写了个小程序: #include <vector> #include <urlmon.h> #include <string> #include <iostream> using namespace std; #pragma comment(lib, "urlmon.lib") int main(int argc, char* argv[]) { int i, j;...标签: C++
[JS]脚本自动查找未注册的域名
这是我在万网注册域名时写的脚本,两位的已经试过了,完全没有可注册的,现在是在搜三位的。 var url_wang = "https://wanwang.aliyun.com/domain/searchresult/"; var cq=['a','b','c','d','e','f','g','h','i','j', 'k','l','m','n','o','p','q','r','s','t', 'u','v','w','x','y','z']; var a=2; var b=6; var c=-1; var result = ""; fu...标签: JS
[JS]Object and String in ajax function
The difference between json object and json string while post with ajax: var login = function(){ var user = $("input[name=username]").val(); var password = $("input[name=password]").val(); var data = { username:user, password:password }; data = JSON.stringify(data); co...标签: JS
日历
最新微语
- 心情不好的时候,换一种生活方式
2026-05-10 18:06
- 有的时候,会站在分叉路口,不知道向左还是右
2023-12-26 15:34
- 繁花乱开,鸟雀逐风。心自宁静,纷扰不闻。
2023-03-14 09:56
- 对于不可控的事,我们保持乐观,对于可控的事情,我们保持谨慎。
2023-02-09 11:03
- 小时候,
暑假意味着无忧无虑地玩很长一段时间,
节假意味着好吃好喝还有很多长期不见的小朋友来玩...
长大后,
这是女儿第一个暑假,
一个半月...
2022-07-11 08:54
分类
最新评论
- Goonog
i get it now :) - 萧
@Fluzak:The web host... - Fluzak
Nice blog here! Also... - Albertarive
In my opinion you co... - ChesterHep
What does it plan? - ChesterHep
No, opposite. - mojoheadz
Everything is OK!... - Josephmaigh
I just want to say t... - ChesterHep
What good topic - AnthonyBub
Certainly, never it ...