手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表2022年10月20日的文章

aliyun composer 镜像可能有问题

 好几次遇到阿里云的镜像更新有问题了,明明某个库有了最新版,但阿里云就是报版本不存在。今天又出现了这样的情况,安装laravel-zero的时候,require-dev中有个laravel/pint ^1.2,直接就报了

 
  Problem 1
    - Root composer.json requires laravel/pint ^1.2, found laravel/pint[dev-main, v0.1.0, ..., v0.2.4, v1.0.0, ..., v1.1.3] but it does not match the constraint.
 
问题是这个laravel/pint 的github上,1.2的release是 9月13日啊。(laravel/pint: Laravel Pint is an opinionated PHP code style fixer for minimalists. (github.com))。
 
由于之前也遇到过这个问题,当时是unset掉 aliyun镜像,换成了官方镜像,但确实是慢,所以我就看了一眼其他镜像,比如以前常用的https://packagist.phpcomposer.com,在国内没有其他镜像的时候,它做了很大的贡献,然而也太不稳定了。直接报:

Problem 1 - Root composer.json requires laravel-zero/framework, it could not be found in any version, there may be a typo in the package name. Problem 2 - Root composer.json requires nunomaduro/termwind, it could not be found in any version, there may be a typo in the package name. Problem 3 - Root composer.json requires laravel/pint, it could not be found in any version, there may be a typo in the package name. Problem 4 - Root composer.json requires mockery/mockery, it could not be found in any version, there may be a typo in the package name. Problem 5 - Root composer.json requires pestphp/pest, it could not be found in any version, there may be a typo in the package name. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details. - It's a private package and you forgot to add a custom repository to find it Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

看来,已经多年没有更新过了,真可惜了。
最后在这里找到了:国内 PHP Composer 镜像列表 - 腾讯云开发者社区-腾讯云 (tencent.com),列表中的那些镜像,象最后的安畅网络的,网址都崩了。所幸,腾讯的还能用。
打开:腾讯软件源 (tencent.com),搜到composer,看一下帮助(真简单就两句话),一句教你配置,一句教你下载。
配好之后,composer u,完成。记录一下
 
 
1、阿里:composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
2、腾讯:composer config -g repos.packagist composer https://mirrors.tencent.com/composer/
3、清除:composer config -g --unset repos.packagist
 
带 -g 的是全局的,不带  -g,就是当前项目了。
 

 

又做了一次服务网站的迁移

在很久很久以前,我其实一直是使用阿里云的,直到后面腾讯也出了云。当然使用量明显没有阿里大,而且我还一直是推荐阿里的。

由于国内的一些原因,有些网站没法备案(比如个人网站,还不能介绍自己做的项目,只能用公司网站。。),所以,部分网站采用了香港的服务器。
 
在早些年吧,用aws的lightsail,便宜,但没有香港区,只有:日本、韩国、新加坡,这些地区吧,白天访问都挺正常,一到晚上就开始抽风,于是几乎全部撤出,采用阿里云香港。
前两年都挺OK。好象从21年起,阿里云香港也开始逐步抽风了,最高的时候丢包率达到了25%左右,白天也是一切正常。
 
因此只能想办法再尝试尝试换了。这次就换到腾讯去了,看看效果如何。
--
话说从03年到现在,也算是用了不少服务器了。
04~05,自己买AMD的芯片组装的windows服务器,托管在上海漕河泾,后因为那边经常断电烧坏了
08年开始,买了朋友的一台dell的2U,托管在edong,也是因为他们迁机房的问题,导致我整个断网2个月,alexa排名从1万掉到10万开外,就再也没有恢复过
11年开始使用linode,然后就是各种其他的大大小小的、知名的不知名的服务器都在尝试,感觉就是在不停踩坑
用过GCP、AWS,还有盛大云、DO,OVH的等。后面因为开始做外包,慢慢全部不再使用,直接用国内的阿里云,这两年在慢慢切回腾讯云。
 
有几个小原因,比如备案,你在A站备案,到腾讯还是不能使用2级域名。必须要在他那边备案,所以才不得不使用香港主机,先用起来,后面备案再切。所幸现在的网站都是git来git去的。基本上部署一个网站也就半小时就行了。
 
没用docker,PHP用docker感觉没啥大意义。之前用过,因为要跑不同的PHP版本,从5.6~8都有,那时候不得不用docker。现在基本上都以7.4为主,即使上8也不会有大问题,所以不再使用Docker了。
 
废话说的太多了,睡觉~