Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPressでPHPのバージョンを更新する方法(正しい方法)

編集メモ: WPBeginner のパートナーリンクから手数料を得ています。手数料は編集者の意見や評価に影響を与えません。編集プロセスについて詳しく知る。

WordPressサイトのPHPバージョンを更新しますか?

WordPressで最新バージョンのPHPを使用すると、サイトのパフォーマンスとユーザーエクスペリエンスが大幅に向上します。多くのホスティングサービスは更新を簡単に行うことができますが、更新を行う前にいくつかの点を確認する必要があります。

この投稿では、WordPressサイトのPHPバージョンを簡単に更新する方法をご紹介します。

How to Update Your PHP Version in WordPress (the RIGHT Way)

WordPressでPHPバージョンを更新する理由

WordPressサイトのPHPバージョンを更新すると、サイトのパフォーマンスが向上します。

WordPressはPHPというオープンソースのプログラミング言語を使って開発されています。この投稿の時点では、少なくともPHP 7.4以上が必要です。

PHPの新バージョンには通常、セキュリティの脆弱性やバグを修正するパッチが 含まれており、あなたのサイトをマルウェアやハッカーから保護します。また、プロセスの実行を高速化し、メモリ使用量を削減する新機能も含まれています。

このため、WordPressを最新の安定版PHPに更新することを強くお勧めします。この投稿の時点では、PHP 8.3.2です。

古いバージョンの PHP を使用している場合、WordPress コア、プラグイン、またはテーマとの互換性の問題により、サイトの安全性が低下し、速度が低下し、エラーが発生しやすくなる可能性があります。このトピックについては、ホスティングサービスによる PHP の更新が WordPress に与える影響についての投稿でさらに詳しく説明しています。

ありがたいことに、ほとんどのWordPressホスティングサービス会社は、WordPressの必須要件を満たすために最新のPHPバージョンを提供するよう努めています。また、PHPは舞台裏で自動的に更新されるため、変更に気づかないこともあります。

とはいえ、PHPの最新ニュースを常にチェックすることをお勧めします。どのような機能や変更がWordPressサイトに影響を与える可能性があるのかを確認してください。プラグイン、テーマ、ソフトウェアが更新後に動作しなくなり、その間に古いバージョンのPHPに戻さなければならないかもしれません。

それを念頭に置いて、WordPressで現在のPHPバージョンを確認する方法を見てみましょう。また、さまざまなホスティングサービスでPHPバージョンを更新する方法をステップバイステップのチュートリアルで紹介します。

WordPressで現在のPHPバージョンを確認する方法

WordPressでは、ホスティングサービスで使用されているPHPのバージョンを簡単に確認することができます。必要なのは、管理ダッシュボードにログインして、ツール “サイトの健全性ページに向かうことです。

次に「情報」タブに切り替える。

Opening the Info tab inside the Site Health menu in the WordPress admin area

次に、少し下にスクロールし、「サーバー」タブをクリックして展開する必要があります。このセクションには、PHPのバージョンを含むサーバーのシステム情報が表示されます。

スクリーンショットにあるように、私たちのデモサイトはPHPバージョン8.1を使用しています。

Checking your server's PHP version in the WordPress Site Health page

WordPressでPHPを更新する前にすべきこと

どのような更新でもそうですが、正式な変更を行う前に、実際のサイトでエラーが発生しないことを確認したいものです。このため、PHP のバージョンを更新する前に以下のことを行う必要があります:

  • WordPressのコア、テーマ、プラグインを更新する – これを行うことで、新しいPHPで効果的に動作するようにすることができます。信頼できる開発者が提供するWordPressプラグインは、通常、新しいバージョンのPHPに対応しています。
  • サイトのバックアップ –Duplicatorのようなバックアッププラグインを使用して、問題が発生した場合に備えてサイトのバックアップを作成しましょう。災害が発生した場合、簡単にエラーフリーなサイトに復元することができます。
  • ステージング・サイトを作成する – 新しいPHPバージョンによるエラーが本番サイトに影響しないように、ステージング環境でPHPを更新してみることをお勧めします。
  • PHP Compatibility Checkerプラグインを使用する –WP Engineによって作成されたこのプラグインは、新しいPHPバージョンから発生する可能性のある潜在的な問題を特定することができます。

BluehostでPHPのバージョンを更新する方法

まず、Bluehostホスティングアカウントのコントロールパネルにログインし、左側の列の’ウェブサイト’タブをクリックする必要があります。

その後、PHPバージョンを更新したいサイトを選択し、「設定」ボタンをクリックします。

Bluehost site settings

では、「設定」タブに切り替えてください。

ここでは、WordPressブログやサイトの高度な設定を確認・設定することができます。

Opening the Settings tab inside the Websites menu in Bluehost

ここで必要なのは、PHPバージョンセクションまでスクロールダウンすることです。

その後、現在のPHPバージョンの横にある「変更」をクリックします。

Clicking the Change button in Bluehost to update a website's PHP version

ここで、更新したいPHPのバージョンを選択します。そして、「変更」ボタンをクリックします。

Bluehostは今、あなたのサイトに選択したPHPバージョンを使用して開始されます。

Selecting a PHP version to update to in Bluehost

HostingerでPHPのバージョンを更新する方法

まず、Hostingerアカウントのダッシュボードにログインし、「ウェブサイト」タブに切り替えます。

ここから、PHPバージョンを変更したいサイトの横にある「管理」ボタンをクリックする必要があります。

これでそのサイトのダッシュボードが表示されます。

Switching to the Websites tab in Hostinger and clicking the Manage button

次に、左サイドバーのAdvancedメニューにある’PHP Configuration’タブを探します。

Hostingerは、選択可能でサポートされているPHPバージョンを表示するようになりました。

使用するPHPのバージョンを選択し、「更新」ボタンをクリックして設定を保存します。

Updating PHP version in Hostinger

サイト、ブログ、オンラインストアのPHP更新を確認するポップアップが外観表示されます。

続行するには「確認」をクリックします。

Confirming a PHP version update in WordPress

SiteGroundでPHPのバージョンを更新する方法

SiteGroundをご利用の場合、WordPressサイトのPHPバージョンを更新する方法は以下の通りです。

まず、SiteGroundアカウントのダッシュボードにログインする必要があります。

その後、「My websites and services」セクションに行き、Websites内の「Manage」ボタンをクリックする。

Clicking the Manage button inside the SiteGround control panel

My Websitesのページが表示されます。

PHPのバージョンを更新したいサイトの下にある「サイトツール」ボタンをクリックするだけです。

Clicking on Site Tools inside the SiteGround control panel

次に、左カラムの’Devs’セクション内の’PHP Manager’メニューを選択する必要があります。

ここから、PHPバージョンタブまでスクロールダウンし、PHPバージョンの横にある鉛筆ボタンをクリックします。

Opening SiteGround's PHP Manager and clicking the pencil button there

ポップアップが表示されます。まず、’Set PHP Version’ オプションで ‘Change PHP version manually’ を選択する必要があります。

その後、ドロップダウンメニューからPHPのバージョンを選択できるようになります。

変更を適用するには、「確認」ボタンをクリックすることをお忘れなく。

Changing the PHP version in SiteGround

HostGatorでPHPのバージョンを更新する方法

最初に行う必要がある HostGator ホスティング アカウント ダッシュ ボードにログインし、’ウェブサイト’ セクションをクリックします。

その後、PHPバージョンを更新したいサイトの「設定」ボタンをクリックします。

Opening the Websites tab in HostGator and clicking the Settings button

次に、「設定」タブに切り替えます。

このセクションでは、サイトの高度な設定を管理することができます。

Opening the Settings section in HostGator

この段階で、PHPバージョンセクションまでスクロールダウンしてください。

次に、現在の PHP バージョンの横にある「変更」をクリックします。

Clicking the Change button in the PHP Version section inside HostGator

更新したいPHPのバージョンを選択するポップアップが表示されます。

選択したら、「変更」ボタンをクリックしてください。

Changing the PHP version in HostGator

DreamHostでPHPのバージョンを更新する方法

DreamHostユーザーの場合は、ホスティングアカウントのコントロールパネルにログインする必要があります。その後、左側のパネルから「ウェブサイトの管理」タブに移動します。

サイトのリストで、三点メニューをクリックし、「PHPバージョン」を選ぶだけだ。

Opening the Manage Websites section and clicking PHP Version in DreamHost

コントロールパネル内のPHP設定ページが表示されます。

ドロップダウンメニューからPHPのバージョンを選択します。その後、「Change PHP Version」をクリックして更新を続行します。

Changing the PHP version in DreamHost

WPエンジンでPHPバージョンを更新する方法

WP Engineは マネージドWordPressホスティングサービス会社で、PHPのバージョンを自動的にアップグレードしてくれます。ただし、サイトのPHPバージョンを手動でアップグレードおよびダウングレードすることもできます。

WP Engineのダッシュボードにログインします。マイサイト」ページで、選択したサイトの横にあるPHPバージョンをクリックします。

Clicking the PHP number link in WP Engine

これにより、サイトの概要設定が表示されます。ここで、WP Engineには、実際にPHPのバージョンを変更することなく、最新のPHPバージョンでサイトをプレビューできる機能があります。

試してみたい方は、「PHPをプレビューする」をクリックしてください。

The PHP Test Driver feature in WP Engine

WP Engineで実際にPHPを更新するには、「更新」セクションまでスクロールダウンしてください。

次に、PHPのバージョン番号のリンクをクリックします。

Changing the PHP version in WP Engine

ここで、’Upgrade to PHP … ‘ オプションを選択します。

その後、「確認」ボタンをクリックしてください。

Confirming to update the PHP version in WP Engine

他のWordPressホスティングサービスでPHPバージョンを更新する方法

ほとんどのWordPressホスティングサービスプロバイダーは、多かれ少なかれ似たような方法で設定を整理します。ほとんどの場合、cPanelまたは他のホスティングコントロールパネルの高度な設定でPHPバージョンを変更するオプションを見つけるでしょう。

見つからない場合は、プロバイダーのナレッジベースを確認するか、サポートチームに連絡してサイトのPHPバージョンを変更することができます。詳しくは、WordPressサポートの依頼方法に関する投稿をご覧ください。

WordPressでPHPバージョンを変更する:よくある質問

WordPressでPHPのバージョンを更新する方法について説明しましたが、このトピックについてよくある質問を取り上げましょう。

PHPのバージョンを更新した後はどうすればよいですか?

WordPressサイトのPHPバージョンを更新した後、すべてが期待通りに動作していることを確認したいと思うかもしれません。サイトを訪問して、すぐに目につく問題がないか確認することをお勧めします。

その後、サイトのWordPress管理エリアにログインします。サイトがWordPressの最新バージョンを使用していること、プラグインと テーマがすべて更新されていることを確認してください。

WordPressを安全に更新する方法については、初心者向けガイドをご覧ください。

PHPの更新でWordPressサイトが壊れた場合はどうすればよいですか?

PHPの更新でWordPressサイトが壊れることはまずありません。しかし、無料プラグインやプレミアムプラグインが豊富にあるため、WordPressの一般的なエラーのうち、不適切なコードの個別行が原因で発生する可能性はまだあります。

まず、このエラーを引き起こしているのがプラグインやテーマではないことを確認する必要があります。そのためには、WordPressのプラグインをすべて無効化し、WordPressの初期設定テーマに切り替える必要があります。

それでも解決しない場合は、ホスティングサービスのサポートチームに連絡してください。あなたが直面している問題がすでに彼らのレーダーに捉えられている可能性が高く、彼らはあなたを支援することができます。

ホスティングサービスが対応してくれない場合は、上記の方法でPHPのバージョンをダウングレードすることができます。

WordPress サイトの PHP バージョンを更新する方法について、この投稿がお役に立てば幸いです。また、市場で最速のWordPressホスティングサービスプロバイダーのリストや、検索エンジンのランキングを上げるための究極のWordPress SEOガイドもご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

14件のコメント返信を残す

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Hajjalah says

    Thanks for this guide. My blog is hosted on Namecheap shared hosting and not managed WordPress hosting. But I have never updated it because I always find my “php version” updated automatically to the latest version, I do not get any notification about it. How is this possible? Can that break my website? What can I do to fix that?

    • WPBeginner Comments says

      This is likely a feature offered by the host.

      If you are concerned a plugin will break, you could reach out to the hosting provider and ask if there is a way to disable PHP automatically updating.

  3. Jiří Vaněk says

    I would like to ask if it is safe to switch WordPress to PHP 8.3 and it is already fully ready for it. I read the article so I know how to do it right. I just don’t know if I should choose this version or prefer 8.2.

    • WPBeginner Support says

      We would first recommend creating a staging site to test that your theme and plugins would not have an issue if you wanted to update to a new version of PHP. It would depend on the specific site for if it is ready for a newer version of PHP.

      管理者

  4. Moinuddin Waheed says

    Thanks for the detailed steps for updating php to the latest version.
    This is absolute must for ensuring the optimum safety and security of the website.
    I think the WordPress core is still the php and it is always prudent to have the latest version.
    However, this step should be taken with utmost caution.
    it may break the website or some of the functionality of the website due to incompatibility issues.
    It is advisable to make a complete backup of the website before updating the php version.

  5. Cristian Radescu says

    I tried changing from 7.4 to 8.1 and when I do that my website returns a 403 error. Anyone knows why?

  6. Yasir Ahmed Khan says

    I did change my php version in c panel but it didnt reflect on my Dashboard it is still 7.3

    • WPBeginner Support says

      We would recommend checking with your hosting provider to ensure nothing on their end prevented the update or that a confirmation is not needed before they update your php.

      管理者

  7. Mornay says

    What do you do if the MultiPHP software is not available on cPanel? Like in my case. What is the RIGHT way then?

    • WPBeginner Support says

      IT would depend on your specific hosting provider, we cover multiple hosts in this list and if your hosting provider is not included and does not use one of the methods from the hosts above, we would recommend reaching out to their support and they should be able to assist.

      管理者

  8. Raaz says

    Thanks for this wonderful article. What is the difference between changing the php verion from above method and using htaccess. Will there be any effect in the site and its performance ?

  9. Fahad says

    Great Article, I just updated the PhP version my entire site went down, and that is because most of the plugins and page builder doesn’t support the newer version of PhP, so I went back to the older version, just wanted to say that, Thanks

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。