php7.4 502error

caddy+php7.4也许是最简易的组合(除了caddy,无须特别配置source.list),但是可能出现php无法运行的情况,提示502错误,log显示permission deny之类的。解决办法,修改/etc/php/php7.4/fpm/pool/www.conf 为:

listen.owner = caddy
listen.group = caddy
listen.mode = 0660

然后重启php7.4-fpm

关于PHP 502错误可以参考这里

phpmyadmin不能登录

安装好mariadb或mysql和phpmyadmin以后,用web方式用root登录phpmyadmin可能会无法登录,提示密码错误一类。

实际上密码是对的,只是本地安全策略一类的问题。解决办法很多,比如修改phpmyadmin设置或是新添加用户,但最简单的是SSH里面输入以下语句:

echo "UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root' AND plugin = 'unix_socket';FLUSH PRIVILEGES;" | mysql -u root -p

OR

mysqladmin -u root password

php无法更新

linux的开源系统包括debian和ubuntu基本上两年就更新一个版本,之后会逐步停止更新,服务器用的LTS(长久支持版本)会维持数年后被关闭更新,但是与之相应的程序比如php,由于需要第三方提供更新,就可能无法维持长久的更新。

debian version code name
继续阅读“php无法更新”

debian11+caddy/nginx+php8.1

很久未有更新,在此深刻道歉!

最近一年多来世界上发生了太多事情,大家都不易。covid19影响在持续,战火依旧在燃烧。关于电脑互联网以及coding方面,也有不少事情发生。win11已经逐步占据主流,微软也会停止win10的支持。关于老旧电脑由于硬件限制只有近2年的电脑才可自动升级成功,但不是说旧电脑不可能升级(太差的还是不要升级了,转不动)。更新到win11的办法我会抽空写一下,不过win10继续用也没多大问题。关于linux vps搭建方面,今天简单分享一下。

debian是我最喜欢的linux系统,作为外行的我来看,一是debian比较精炼,二是功能足够。debian11已经发布,替代了短命的debian10(据说bug多)。那么在debian11上搭建常用的服务器环境如何install呢

继续阅读“debian11+caddy/nginx+php8.1”

旧debian更新源

debian在今年8月已经发布了debian11,而很多主机的版本还是10.3,在更新是会提示找不到源无法更新,可以修改/ect/apt/source.list里面的源地址来继续更新。(这里是阿里云的源)

deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

除了系统,PHP,mariadb这些程序在使用一段时间后也可能会出现过期无法更新的问题。需要使用apt-key来更新OpenPGP key. apt-key的选项有:

apt-key add <file>          - add the key contained in <file> ('-' for stdin)
  apt-key del <keyid>         - remove the key <keyid>
  apt-key export <keyid>      - output the key <keyid>
  apt-key exportall           - output all trusted keys
  apt-key update              - update keys using the keyring package
  apt-key net-update          - update keys using the network
  apt-key list                - list keys
  apt-key finger              - list fingerprints
  apt-key adv                 - pass advanced options to gpg (download key)

首先需要在官网上去下载最新的GPG文件,再用上面这些来添加进souce.list里面。mariaDB最新的版本是10.7 ,在这里下载更新

关于key失效也可以看这里。关于dirmngr文件夹找不到,可以看这里debian上的PHP版本更新看这里,包括GPG文件。

debian和php

新败的主机开始折腾!系统选debian7×64,服务器选LEMP(也就是LNMP),而不是常用的LAMP,因为NGINX似乎更简单高效,而且fastcgi的运行模式似乎也比apache内置模式要好
。Nginx (pronounced “engine x”, providing the “E” in LEMP). 继续阅读“debian和php”