Migration of core server V1 to a new server and Perl 5.26 incompatibilities, resolving PHP 7.4 deprecated issues

update Last updated: December 16, 2023 at 10:33 PM

This site is managed and operated by Senri on the rental server GMO Digirock's core server (V1). This time, it has been decided to migrate this server to the new server as follows, and the system migration to the more powerful server has been completed.
Core servers offer superior stability and speed by adopting the latest system, up to 64 cores of high-speed CPU, up to 1TB of large memory, high-speed SSD RAID for all plans, and support for free SSL, HTTP/3, and TLS 1.3.

The main changes in the migration are as follows:

  • CPUUp to 28 cores ⇒ Up to 64 cores
  • memory Up to 384GB ⇒ Up to 1TB
  • PHP (default)7.1 + FastCGI + OPcache + APCu(5.3/5.4/5.5/5.6/7.0FastCGI selectable) ⇒ 7.4+ FastCGI + OPcache + APCu(5.6/7.0/7.1/7.2/7.3/8.0/8.1FastCGI selectable)
  • Perl (default)Series 5.16 ⇒ Series 5.26
  • MySQL (default)5.7 ⇒ MariaDB 10.6

As mentioned above, the Web server has become high spec, and the display of the Web site has become dramatically faster. This is very gratifying, but some CGI programs stopped working as we migrated to the new server.
As for PHP, it already supports PHP 7.4, so there was no problem, but I was wary when it came to Perl. Perl runs CGI programs such as access counters, access aggregations, bulletin boards, and launchers.
As a result of our research, we found the following incompatibilities regarding Perl 5.26 on our site: Both result in a 500 ERROR.

  • Due to a security problem, the following notation indicating the current directory is treated as an error

    $thisfile = ‘./cgi.cgi’;

  • Japanese Translation Library jcode.pl Does Not Work with Perl 5.26

    require ‘./jcode.pl’;

This issue was resolved by addressing each of them as follows:

Specifying the Current Directory

Add one line below.

use lib ".";
$thisfile = './cgi.cgi';

jcode.pl incompatibility issues

Introduce the Japanese translation library jacode.pl to replace jcode.pl and change the call part as follows.
The latest version of jacode.pl isjacode-2.13.4.18 You can download more.

require './jacode.pl';
  # JISコード変換
  jacode::convert(\$mbody,'jis','sjis');

For the time being, the display on the surface is normal, but since the verification of the entire program has not been completed yet, we plan to continue testing.

Error when migrating to the new server and updating articles containing 4B codes (utf8mb4) such as emojis

2022.06.10 Update

After migrating to the new server, when I updated the article with 4B code (utf8mb4) such as emoji, I got the following error and could not update the article.

更新に失敗しました。データベースの投稿を更新できませんでした。

I tried to repair the DB several times here, but it did not work.

Out of necessity, I contacted the core server support and asked them to repair it with the DB before migration. However, the result was NG.
So, after a lot of trial and error, I was able to repair the DB safely by the following method!
You can now enter and update emojis.

1.「 Login to phpMyAdmin" ⇒ Select the database name you want to change
2. Select the "Operations" tab in the header ⇒ Look at the part where "Collation" is written.
3. Specify "utf8mb4_general_ci" in collation and click "Execute"

* We have also posted a topic on the WordPress support forum below, but after verification, if there are no problems, we will close this thread.

* The corresponding articles are as follows:

2022.06.30 Update

PHP 7.4 Deprecated / PHP 8.0 Incompatibility Issues

I will repost the additions to the following article.
Among the WordPress plugins, we found functions that were deprecated in PHP 7.4 and deprecated in PHP 8.0.

In the PHP 7.4 environment, the following warnings are confirmed when running in debug mode.

[28-Nov-2021 05:19:48 UTC] PHP Deprecated:  join(): Passing glue string after array is deprecated. Swap the parameters in /**********/public_html/www.senris.com/*****/wp-content/plugins/hpbseo/hpbseo.php on line 517

This means that the use of the join() function written in hpbseo.php is deprecated.
There are two places where it is applicable, which is described as follows.

    //エラーメッセージ取得
		$err_msg = join($err_tmp,'<br />');

This join() function is an alias of implode(), but the above form was deprecated in PHP 7.4 and removed from the specification in PHP 8.0. Therefore, we will modify this part as follows.

  //エラーメッセージ取得
  //$err_msg = join($err_tmp,'<br />');
	$err_msg = join('<br />',$err_tmp); // for PHP 8.0
Add this entry to the hasebookmark
X (post)

Leave a Reply