トピック
WordPress のサイトをもっと速く安全にすることができます。今すぐ PHP をバージョンアップしましょう。
この記事では PHP をバージョンアップすべき理由とその方法について説明します。
PHP が重要な理由
PHP is one of the programming languages that WordPress is built on. Your hosting company determines which versions of PHP are available for your site, and many hosters let you change this yourself. And while you may be familiar with the importance of keeping WordPress, and your themes and plugins up-to-date, keeping PHP up-to-date is just as important.
PHP の最新バージョンには大きく2つの利点があります。
- Your website may be faster because PHP becomes more efficient with each new version. Updating to WordPress’s recommended PHP version (currently 7.4 or higher) can deliver a performance increase that will benefit all visitors to your website.
- Your website will be more secure. PHP, like WordPress, is maintained by its community. Because PHP is so popular, it is a target for hackers – but the latest version will have the latest security features. Older versions of PHP (lower than 7.4) do not have this, so updating is essential to keep your WordPress site secure.
さらに副次的な利点がいくつもあります。
- 速い WordPress サイトは検索エンジンに高く評価されます。したがって検索ランクが上がります。
- 速いサイトは訪問者の滞在時間が長くなります。訪問者は読み込みに長い時間がかかれば離脱しますが、パフォーマンスが良ければサイトはその分効果的になります。
- 高いセキュリティを保つサイトはハッカーに対してより安全です。サイトがハッキングされれば対応コストがかかりますし、サイトの評判も下がります。
以上の利点はあなたにとってもサイトの訪問者にとっても有用です。これらが、PHP を更新すべき理由です。次にその方法について説明します。
How to check your PHP version
To check what version of PHP your WordPress site is using, from the WordPress Dashboard, select Tools > Site Health from the sidebar menu, and then select the Info tab. Expand the Server section and scroll down until you see PHP version.
If this number is at or higher than PHP 7.4, then you don’t need to update PHP at this time!
However, if your site is lower than the recommended version, running on an outdated and insecure version of PHP, then it’s time to update. You also may have noticed a warning such as “PHP Update Required” or “PHP Update Recommended” on the Dashboard or in Site Health – these serve as important reminders to update PHP and make your site more secure.
PHP をバージョンアップする前に
この節は警告から始まりますが、安心してください。ほとんどが技術的な話で、PHP のバージョンアップ前に必要ないくつかの背景情報を説明するだけです。
Updating your PHP version should not be a problem, but we can’t guarantee that it’s not. WordPress itself works with PHP as far back as version 5.6.20, but we don’t know if your themes or plugins will work on newer versions. They should, and popular or reputable ones almost certainly will, but they should be tested to make sure.
There are a couple of steps you should take to avoid problems before proceeding:
- サイトのバックアップを作成する: バックアップがあれば何か起きた場合にサイトを現在の正常な時点に戻せます。多くの無料のバックアッププラグインを利用できますので、もし現在、バックアップ手段を持っていなければ、どれか1つをインストールしてバックアップを取得してください。バックアップに戻すには、ホストの PHP のバージョンも現在のものに戻す必要があります。方法については後述します。
- Update WordPress, themes, and plugins: from your WordPress Dashboard, head to the Updates page under the Dashboard > Updates menu, and then update everything. You should do this regularly anyway :). When done, check that your site is working as expected.
- PHP の互換性をチェックする: PHP Compatibility Checker プラグインをインストールし、テーマやプラグインの互換性をチェックしてください。このプラグインによるチェックも完璧ではなく、項目やフラグを誤って判定する場合もありますが、ほとんどのケースで正しく動作します。
- PHP 互換性の問題を修正する: PHP Compatibility Checker プラグインが問題を報告する場合には、該当するテーマやプラグインの開発者に連絡し、調査を依頼してください。もし修正できない場合、または連絡がない場合には、WordPress.org 上で同じ機能を持つ代替のテーマやプラグインを検索し、インストールしてください。
以上の手順を終えれば、WordPress サイトの PHP をバージョンアップできます。サイトのパフォーマンスを向上し、安全性を高めましょう。
手順の途中でエラーが発生したりヘルプが必要になった場合は、周囲の Web 開発に詳しい人やレンタルサーバー会社、テーマやプラグインの作者に相談してください。きっと喜んで手助けしてくれるでしょう。
最後のパートは、サイトの PHP のバージョンアップについてです。
サイトの PHP をバージョンアップして、より速く、より安全にするには
サイトの PHP をバージョンアップする準備が整いました。ここまで細心の注意を払い、バックアップを取得し、可能な限りバージョンアップに最適な状態にあるはずです。
PHP is installed on your website’s server, so updating it involves either interacting with your host’s settings or asking your provider to do it for you.
Exactly how to do the update depends on your hosting company. We’ve asked hosting companies to submit instructions on how to update your PHP version on their hosting, and you’ll find a list of hosts who have instructions available here.
リストに会社名がない場合は、メールで問い合わせましょう。以下にメールの雛形を添付します。
Dear Hosting Provider,
I want my WordPress website to be as performant and
secure as possible with the latest version of PHP.
If the server my site is hosted on is not already on
the latest version of PHP, please let me know what
steps I need to take to update it.
Thanks!
この段階でうまく動作しない場合は PHP のバージョンを自分で戻すか、レンタルサーバー会社や Web 開発に詳しい人に相談してください。手順としてはまず使用していた PHP のバージョンを戻すようレンタルサーバー会社に相談してください。次に、取得していたバックアップで元に戻します。
アップデートに必要な情報はこれですべてです。読んでいただき、ありがとうございます。PHP の最新バージョンを使用して、より速い、より安全なサイトを楽しみ、訪問者を幸せにしましょう。
より速く安全な WordPress サイトを全員に
最新の PHP バージョンを使うということは、Web サイトが可能な限り高速で安全であることを意味します。
これまで PHP の最新バージョンにアップデートする方法について説明しましたが、将来のバージョンアップでも同様の方法で更新できます。WordPress の管理画面に表示される PHP アップデートのお知らせや、レンタルサーバー会社のニュースに注意してください。
最後に。追加の質問があればレンタルサーバー会社や Web 開発者、テーマやプラグインの作者に相談してください。全員、専門分野についての助言を惜しまないはずです。
インターネットをより良い場所にするためのご協力に感謝します !