2020年4月

在 Aliyun Linux 2 里安装 PostgreSQL 9.5

环境:阿里云ECS实例,4GB内存,Aliyun Linux 2 系统。

过程:

  1. cat /etc/redhat-release # 查看系统版本 Aliyun Linux release 2.1903 (Hunting Beagle)
  2. rpm -ivh https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm # 安装postgresql的yum安装源
  3. yum install postgresql95 postgresql95-server postgresql95-libs postgresql95-contrib postgresql95-devel # 安装 postgresql95
  4. vi /etc/yum.repos.d/pgdg-redhat-all.repo # 查看或编辑里边的源地址,如果 $releasever 错误识别为 7-6.1810.2.el7.centos,可直接将$releasever替换为7.6
  5. /usr/pgsql-9.5/bin/postgresql95-setup initdb # 初始化数据库
  6. systemctl start postgresql-9.5 # 启动postgresql
  7. yum install postgis2_95 postgis2_95-client # 安装 postgis

参考:

mysql_install_db.exe - 安装MariaDB为 Windows 服务

现象:通过宝塔面板安装的MariaDB在删除宝塔面板后,需要手动启动。

步骤:C:\Program Files\MariaDB 10.2\bin\mysql_install_db.exe --service=MariaDB10 --datadir="C:\Program Files\MariaDB 10.2\data" 执行mysql_install_db.exe的程序,将MariaDB注册为服务,这样可从服务列表里启动。

但要注意,操作前请先备份data目录的文件,因为有的用户反馈执行mysql_install_db.exe时可能会删除已有data目录的文件,即可能会删除已有的所有数据库。

参考:

magento2 - An exception was raised while creating “Request”; no instance returned

环境:magento2

现象:访问网站,有的js文件提示拒绝访问。在网站服务器查看相应的js文件不存在,尝试用 php bin/magento setup:static-content:deploy -f 重新生成静态文件等时,提示出错,出错信息如 An exception was raised while creating “Request”; no instance returned

尝试:查看当前服务器是否安装了多个版本的php。如有多个版本的php,请用网站安装时相应版本php来执行命令,如 /usr/bin/php7.2 bin/magento setup:static-content:deploy -f

参考:https://magento.stackexchange.com/questions/256953/an-exception-was-raised-while-creating-request-no-instance-returned