更新 Apache、MariaDB、PHP

  之前因為公司網站被植入惡意程式的關係建置了一個新的網站平臺並且捨棄 appserv 這類快速建置但僅適用於開發環境的套件改以手動建置 ApacheMariaDB 以及 PHP之後並以每半年更新一次的頻率做維護本篇即為記錄更新 ApacheMariaDB 以及 PHP 這三個程式的步驟

 

 

首先停止 Apachemysql (MariaDB) 服务。

【更新 PHP – 非线程安全】

  • 官方网站 下载非线程安全压缩包。
  • 解压缩,复制目录到目标位置。
  • 将 php.ini-production 修改为 php.ini,使用 WinMerge 对比旧版 php.ini。
  • 如果 php 目录名称与原名称不同,開啟 Apache 的 httpd.conf ,修改以下内容:
  • FcgidInitialEnv PHPRC "D:/Web/php-7.4.6"
    # 讓 FastCGI 知道 php.ini 所在目錄。
    
    FcgidWrapper "D:/Web/php-7.4.6/php-cgi.exe" .php
    # FastCGI 設定。
  • 双击 Apache 的 httpd.exe,如果出现错误,逐一修复,确认没有问题后以服务方式启动。
 

【更新 PHP – 线程安全】

  • 官方网站 下载线程安全压缩包。
  • 解压缩,复制目录到目标位置。
  • 将 php.ini-production 修改为 php.ini,使用 WinMerge 对比旧版 php.ini。
  • 如果 php 目录名称与原名称不同,開啟 Apache 的 httpd.conf ,修改以下内容:
PHPIniDir "D:\Web\php-7.1.5"
# 指定 php.ini 存放的資料夾位置。

LoadModule php7_module "D:\Web\php-7.1.5\php7apache2_4.dll"
# 載入 php 的模組。
 

【更新 Apache】

  • Apache Haus Download the compressed file (x64)。
  • 解压缩,Copy the Apache24 directory to the desired location。
  • Open httpd.conf,Use WinMerge to compare the old httpd.conf。
  • Copy the data from the original Apache24/htdocs directory to the new Apache24/htdocs。
  • Compare the old and new Apache24/bin directories,Copy the custom lib***.dll files,To the new Apache24/bin,Such as libsasl.dll、libssh2。
  • If PHP uses Non Thread Safe,Copy mod_fcgid.so from the original Apache24/Modules,To the new Apache's Apache24/Modules。
  • 若還有其他 SSL 憑證或修改過的檔案也記得搬移
  • 雙擊 httpd.exe,如果出现错误,逐一修复,沒問題後再改以服務啟動
 

【更新 MariaDB】

  • MariaDB 官網下載 64bit msi 檔
  • 停止 mysql 服務執行 .msi 檔更新即可
 

【更新 phpMyAdmin】

  • phpMyAdmin Download the compressed file,解压缩,複製到 Apache24\htdocs
  • 将 config.sample.inc.php 重命名为 config.inc.php,用 WinMerge 比對舊版 config.inc.php
 

【相關連結】

留下回复

您的电子邮件地址不会被公开. 必填项已标注 *

本网站使用 Akismet 来减少垃圾评论. 了解您的评论数据如何被处理.