do not use tar, tar is not for .zip file
try this
unzip [ file name ]
do not use tar, tar is not for .zip file
try this
unzip [ file name ]
我们有时候需要定时执行主机上的PHP脚本,如定时采集等。本文介绍在HostMonster主机上怎么使用Cron jobs运行php文件。
image
其实HostMonster 的cPanel面板的Cron jobs就为这个功能提供了实现,下面一起来看看应该如何操作吧!
步骤:
1、登录cPanel面板,点选Cron jobs
2、选择Standard
3、在Command to run:里输入执行语句,格式:”/usr/bin/php -q /home/USERNAME/public_html/PathToFile”
4、在下面设置自动执行此文件的时间点
可以在上面输入你的邮箱地址,这样,当此文件被执行时就会自动发一个通知到你的邮箱
注意:上面执行域名的USERNAME要改成你自己的用户名,PathToFile要改成你要执行的文件的路径
刚购买HostMonster的用户,想要转移站点,把其它站点上的文件、图片,全部转到HostMonster去,用户先用tar打包后wget 到HostMonster,在tar解压缩,用户考虑到HostMonster CPU限制比较多(20%CPU占用限制,每分钟占用40秒CPU限制,程序执行最长5分钟限制),担心wget tar之类的命令执行要连续耗费大量时间,就想要知道,这样是否违反HostMonster的CPU使用限制?,是否会在指向这些命令中被强制终止进程?
一般来说wget占用CPU较少,HostMonster空间限制单个进程运行时间不超过5分钟.所以wget运行到5分钟时候就会中断,用户可以 用wget -c 实现续传.或者买独立IP,如果你使用独立IP,HostMonster不会限制程序执行时间,可长时间使用还是会超CPU限制的,tar命令时间长将导 致站点暂时挂掉,
Hostmonster空间是可以申请SSH的, 但能用好它的我看没多少人
原来我一直在用一个很爽的功能,就是
php …. &
就是SSH上去以后,让PHP程序在命令行下执行, 然后exit,它就一直执行下去了,不需要等返回结果,退出以后,这个进程会在后台继续执行,不会被关闭
以前我就曾经这样一条命令,连续采了一个月,采了千万级数据
昨天如法炮制,可惜,却已经不能用了,只要退出ssh客户端,服务器会自动把那个进程给kill了
1. lamengao 于 2008-02-28 18:33:02 发表:
用nohup呀
nohup php script.php &
就可以了。
或者直接在php文件中加#!/usr/bin/php,然后赋予可执行权限。
然后 nohup script.php & 也可以。
Reply
2. Andy 于 2008-02-28 18:47:52 发表:
nohup也不成,进程会被杀,毕竟不是自己的服务器
我在写WP插件的时候就试过
Reply
3. lamengao 于 2008-02-28 19:12:51 发表:
难道是服务器问题?我用的hostmonster空间就可以。
如果nohup都不行,那你完全可以给hostmonster写信反映。
Reply
m hosting my new blog, Supreme Commander Talk, with HostMonster. For only $8 a month (to get the $6/month they advertise you have to pre-pay two years in advance), it’s been a pretty good deal. I had one extended issue with downtime the day after I started hosting there and one smaller thirty minute incident when the host my site was on rebooted, but that was about it. I guess I would recommend it to other people. Just don’t expect 99.9% reliability like they claim.
Yesterday I looked into setting up a legitimate BitTorrent tracker as a part of Supreme Commander Talk. Supreme Commander players could use it to host their mods, replays, videos, custom maps, etc. I say legitimate because I’m really trying to support the game, and so any illegal content, like a rip of the game itself, would be banned. But unfortunately, HostMonster won’t let me run a tracker. Everything in the installation process goes smoothly, including running the tracker itself. It’s just that their Apache is configured to drop all files from HTTP POSTs that contain .torrent files. So, the tracker will run, but you can’t upload any torrent to the tracker, so it never has anything to track. Thanks HostMonster. I actually spent a bit of time debugging this trying to figure out what in the world was going on. Needless to say, service providers are very quick to say what they do offer and very hesitant to say what they prohibit. I was actually only able to figure this out through a forum posting by someone else with the same problem; HostMonster doesn’t seem to list this restriction anywhere on their site.
Ah well, I suppose I understand why they did it. There are lots of illegitimate torrent sites out there, and they don’t want to run any sort of legal risk. But still, BitTorrent is just a protocol for transferring files, and is used legitimately for such purposes as distributing Linux ISOs, and, hopefully one day, an easy way for Supreme Commander fans to share their created content with others.
北山虚拟主机评论在首页增加了美国主机的排名列表,也就是所谓的美国主机排名,其实这个表格放在北山博客的首页便于有需要的朋友,在选择美国主机时进行参考。
GoDaddy的独立IP是比较贵的,每个月需要$2.99美元。相比之下,Lunarpages、HostMonster等虚拟主机商的独立IP价格为$2.5美元/月。
(more…)
因为今天帮人买的一个HostMonster虚拟主机的IP被封了,购买完在国内就没法访问,新买的虚拟主机被分配到host187.hostmonster.com服务器上。于是想看看HostMonster的服务器共享IP到底有多少被封了。
(more…)
想找个支持python的hosting很不容易。
GAE虽好,但是动不动就被墙了,三天两头不能用(特别是重大政治事件前夕),不靠谱
WebFaction直接支持python,但是性价比有点低
Hostmonster, bluehost, Dreamhost等知名主机商官方只支持php,但是通过一些DIY,也可以实现python的fastcgi部署。
本文的配置方法在这几个host也基本适用。
答:php 的fsockopen函数用来创建一个socket连接。但因为HostMonster在共享IP的主机里使用了防火墙(方便跟踪用户的流量),所以,当 fsockopen用来连接有别于80端口的URL地址时,是不奏效的。如果您需要连接其他端口,需要向HostMonster另外订购独立IP的费用。您可以提供在档信用卡的后四位或直接打电话来申请。
Powered by WordPress