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

XAMPPを使ってローカルWordPressサイトを作成する方法

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

WPBeginnerチームは、定期的にコンピューター上にローカルWordPressサイトを作成し、本番サイトに影響を与えることなく、テーマ、プラグイン、サイトの機能をテストしています。

XAMPPは、ローカルのWordPressインスタンスをセットアップするためのユーザーフレンドリーなプラットフォームを提供する、フリーでオープンソースのソフトウェアパッケージです。

この投稿では、XAMPPを使用して簡単にローカルのWordPressサイトを作成する方法を紹介し、安全な環境でWordPressを試したり、開発者のスキルを磨いたりできるようにします。

Creating local WordPress install using XAMPP

なぜローカルWordPressサイトを作るのか?

ローカルWordPressサイトの作成は、開発者やサイトオーナーの間では一般的な手法です。インターネット上に実際のサイトを作成することなく、WordPressをテストすることができます。

ローカルサイトは、コンピューター上でしか見ることができません。さまざまなWordPressテーマやプラグインを試したり、機能をテストしたり、WordPressの基本を学んだりすることができます。

すでにWordPressのウェブサイトをお持ちの場合は、コンピュータ上にウェブサイトのローカルコピーを作成し、本番のウェブサイトにプラグインを実装する前に、新しいプラグインの更新を試すことができます。

重要:ローカルサイトは、あなたのコンピューター上でしか見ることができません。ライブサイトを作りたい場合は、ドメイン名と WordPressホスティングサービスが必要です。

ライブサイトを作成する準備ができたら、WordPressブログの始め方ガイドのステップバイステップの指示に従ってください。

それでは、XAMPPを使ってWindows、Mac、LinuxにWordPressをローカルインストールする方法を紹介しましょう。

XAMPPとは何ですか?

XAMPPは、コンピューター上にローカルサーバー環境を構築するために必要なものがすべて含まれているソフトウェアパッケージです。

ローカルのWordPressサイトを作成するには、コンピューターにWebサーバーソフトウェア(Apache)、PHP、MySQLをセットアップする必要があります。

PHPはプログラミング言語であり、MySQLはデータベース管理ソフトウェアである。WordPressを動かすには、この2つが必須です。

これらを区切りインストールするのは初心者にはかなり難しいです。そこでXAMPPの登場です。

XAMPPを使えば、WordPressサイトをローカルで簡単に構築できます。Windows、Mac、Linuxベースのコンピューターでご利用いただけます。

さっそくXAMPPをインストールし、ローカルのWordPressサイトを実行するように設定しましょう。

コンピューターへのXAMPPインストール

まず、XAMPPのサイトにアクセスし、お使いのOSの「Download」ボタンをクリックしてください。

Download XAMPP to your computer

お使いのオペレーティング・システムによっては、インストール・ウィザードやアプリケーション・インターフェースがここに掲載したスクリーンショットと異なる場合があります。この投稿では、Windows版のソフトウェアを紹介します。

XAMPPをダウンロードしたら、インストーラをクリックして実行します。

XAMPP set up wizard

XAMPPはソフトウェアのインストール先とインストールしたいパッケージを聞いてきます。ほとんどのユーザーは初期設定で問題ありません。そのまま「Next」ボタンをクリックしてセットアップウィザードを終了してください。

ウィザードが終了したら、’start the control panel now’ オプションをチェックし、’Finish’ ボタンをクリックする。

Finish set up and launch XAMPP control panel

これでXAMPPコントロールパネルアプリが起動します。

XAMPPアプリを使用すると、Apache Webサーバーをローカルサーバーとして、MySQLをデータベースサーバーとして実行することができます。ApacheとMySQLの隣にある「Start」ボタンをクリックしてください。

Start Apache and MySQL to launch your local server

XAMPPはApacheとMySQLを起動します。

Windowsファイアウォールの通知が表示される場合があります。両方のアプリケーションをコンピューター上で実行するには、「アクセスを許可」ボタンをクリックすることが重要です。

Allow firewall access to Apache and MySQL

両方のアプリケーションが起動すると、名前が緑色にハイライトされます。

これで、XAMPPを使ってローカルサイトを作成し、WordPressをインストールする準備ができました。

XAMPPでローカルWordPressサイトを作る

まず、WordPressをダウンロードする必要があります。WordPress.orgのサイトにアクセスし、「Download WordPress」ボタンをクリックします。

Download WordPress

WordPressをダウンロードした後、zipファイルを解凍すると、WordPressフォルダーが表示されます。

このフォルダーをコピーする必要がある。

WordPress folder

次に、XAMPPのインストールフォルダーに移動します。

Windowsでは、C:/Program Files/XAMPP/htdocsまたはC:/Xampp/htdocsとなります。

Macでは、/Applications/XAMPP/htdocsとなります。

先ほどコピーしたWordPressフォルダーを「htdocs」フォルダー内に貼り付けます。

WordPress’フォルダーの名前を’サイト’などに変更することをお勧めします。こうすることで、ローカルサイトを簡単に識別できるようになります。

Rename WordPress folder

次に、お気に入りのウェブブラウザーを開く必要がある。

以下のURLをブラウザーのアドレスバーに入力してください:

https://localhost/website1/

WordPressフォルダーの名前を他の名前に変更した場合は、’website1’を自分のフォルダー名に置き換えてください。

WordPressのインストール・ウィザードが起動し、言語の選択を求められます。言語を選択したら、「Continue」ボタンをクリックします。

Select language

次の画面では、WordPressのウェルカム画面が表示されます。

WordPressがデータベース名、データベースのユーザー名、パスワード、ホスティングサービスを必要としていることが表示されます。

WordPress installation requirements

WordPressサイトのデータベースを作成しましょう。

新しいブラウザータブを開き、https://localhost/phpmyadmin/。

これで、XAMPPにプリインストールされているphpMyAdminアプリが起動します。よりシンプルなインターフェースでデータベースを簡単に管理することができます。

データベース」をクリックし、新規データベースの名前を入力します。その後、「Create」ボタンをクリックして続行します。

Creating a database for your local WordPress site

これでデータベースが作成できたので、WordPressサイトで使用することができます。

localhost/website1/ブラウザータブに戻り、「Let’s Go」ボタンをクリックする。

次の画面では、WordPressデータベース情報の入力を求められます。

先ほど作成したデータベース名を入力する。ユーザー名は’root’で、パスワード・フィールドは空白にしておく。データベースのホスティングサービス欄には、localhostを使用する必要があります。

Enter your WordPress database information

入力が終わったら、「送信」ボタンをクリックして次に進みます。

WindowsまたはLinuxをお使いの場合、WordPressはこれらの設定をwp-config.phpというWordPressの設定ファイルに保存します。

しかし、Macを使用している場合は、ファイルのコンテンツが表示され、そのファイルを作成するよう求められます。

このファイルはサイトのルート・フォルダーに作成する必要があります。

ファイルを作成したら、その中に先ほどコピーしたテキストをペーストする。次に、ファイルを保存し、WordPressインストーラに戻って続行する必要があります。

次のステップで、WordPressはあなたのサイトに関する情報を提供するよう求めます。まず、このサイトに使用するタイトルを入力します。

その後、管理者アカウントのユーザー名、パスワード、メールアドレスを入力する必要があります。

Enter your local site information

すべての情報を入力したら、「WordPressをインストール」ボタンをクリックして続行します。

WordPressはインストールを実行し、完了したらログインするよう促します。

localhost/website1/wp-adminページにアクセスし、インストール時に入力したユーザー名とパスワードを使用してログインすることができます。

WordPress login page

ローカルWordPressサイト作成後に試すべきこと

XAMPPを使ってローカルのWordPressサイトを作成したら、本番のWordPressサイトと同じように作業することができます。

WordPress管理画面のサイドバーにある外観メニューから、サイトの外観をカスタマイズしたり、新しいテーマをインストールすることができます。

ここでは、あなたが試すことができるいくつかの素晴らしい無料のテーマを紹介します。

次に試したいのは、WordPressプラグインのインストールだ。

プラグインはWordPressサイトのアプリのようなもので、お問い合わせフォーム、ソーシャルメディアボタン、eコマースストアなどのクールな機能を追加することができます。

プラグインのインストールでお困りですか?WordPressプラグインのインストール方法については、ステップバイステップのガイドをご覧ください。

ボーナス:ローカルWordPressサイトをライブサーバーに移動する

ローカルのWordPressサイトで作業した後、それをライブサーバーに移動して、初めてのWordPressブログやウェブサイトを作りたいと思うかもしれません。

そのためには、ドメイン名とホスティングサービスが必要です。通常、ドメインネームは14.99ドル、サイトホスティングサービスは月額7.99ドルから。

まだ駆け出しなら、それはやりすぎだ。

幸いなことに、BluehostはWPBeginnerユーザーにドメイン名を無料で提供し、ホスティングサービスを大幅に割引している。基本的に、月額$1.99で始めることができる。

その他のホスティングサービスについては、WordPressホスティングガイドをご覧ください。

ホスティングサービスにサインアップしたら、WordPress をローカルサーバーからライブサイトに移行する方法をステップバイステップで説明します。

また、WindowsではWampserverMacではMAMPを使ってローカルWordPressサイトを作成する方法もあります。

ローカルWordPressサイトのエキスパートガイド

XAMPPを使ってローカルWordPressサイトを作成する方法はおわかりいただけたと思いますが、ローカルWordPressインストールに関する他のガイドもご覧ください。

この投稿で、XAMPPを使ってローカルWordPressサイトを作成する方法をご理解いただけたと思います。あなたのサイトにWordPressを使うべき理由や、専門家が選ぶ最高の無料ホスティングサービスもご覧ください。

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

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

  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. André Bruwer says

    Hi there WPBEGINNER SUPPORT

    Great article thank you :)

    I was wondering… is it better to develop a wp website for a client live or better to build it locally then transfer it to the hosted wp site with duplicator or something similar?

    Any advise would be greatly appreciated. Can’t figure this one out.

    Thanks
    André

  3. Chaitra says

    Hi, I am getting following error when I connect to localhost/website1
    You don’t have permission to access /website1/ on this server.
    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

  4. Chaitra says

    Hi, I get the following error when I access localhost/website1 –
    You don’t have permission to access /website1/ on this server.
    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

  5. rocky says

    Thanks for the Knowledge but how can i make it live through Xampp. Let us know if theres any tutorial

    • bala says

      yes there is a way to put your localhost online, you should redirect your domain name to your computer’s ip address

  6. Jojo says

    Hi,
    I followed your tutorial and created a wordpress site. How can I create another local wordpress site with this setup?

  7. paul says

    hi, i have been able to login to wordpress using xampp, but when i click on the themes area i only see three themes. when i try to install a new theme, im notified that there is an error. please i need your help.

  8. Shamrat Hossain says

    This article was really helpful for me . Hope You will be doing good works like this for us in future ..

    Thanks

  9. Abhijith says

    Hi Team

    I have problem with xampp server once installation itz working fine after shutdown if am going to using again in the xamm server buttons not working
    it asking again and again tomcat file….please let me know how to fix it

  10. Suraj Barthwal says

    you’r article was really helpful. i do have a query for you though, what should i do if i wanted to extract my wordpress live website so i could use it in future.

  11. Mario Bergeron says

    Hi,

    Thanks for your article really helpful. Everything works fine, installation etc., but I try to install a theme on my WP and i got this message ”The uploaded file exceeds the upload_max_filesize in php.ini.” What can I do to install my theme??

    Thank you to help me.

    Mario Bergeron

  12. JERSon says

    Hi ALL,

    im stuck at localhost/website1 …it will give the error page

    This site can’t be reached
    localhost refused to connect.
    Search Google for localhost website1
    ERR_CONNECTION_REFUSED

    Please help

  13. Emmanuel says

    Hello WordPress, I have installed and used Xampp yesterday and it worked very fine but whike trying to open and use it today, its taking back to the installation process and asking for a new storage location. How do I go about this?

  14. ayush singh chauhan says

    Sir , when i try opening localhost/website1
    then something else opens which is not similar to yours.
    that is showing index of website ..
    what should i do now

  15. Stanley says

    When I finish with a website and wish to build another different website, how do I go about it? Thanks.

    • WPBeginner Support says

      Hi Stanley,

      Create a new folder for your website inside htdocs folder and repeat all the steps mentioned under ‘Creating a Local WordPress Site with XAMPP’ section.

      管理者

  16. Jonathan Pienaar says

    Great tutorial, and works 99% for Linux. (I had to create wp-config.php manually for some reason).

    Only other issue: trying to use the Elementor Page Builder plugin, but it requires an FTP login/password. Tried starting FTP server, but can’ figure out how to configure it so that I can give Elementor FTP access/download the plugin.

    (Hope this makes sense).

  17. Bhagwat Pawar says

    nice and practically perfect. can i add email functionality here installing gmail smtp or wp smtp plugin

  18. Jane says

    This was so easy to follow. Thank you very much,

    When I want to upload a theme in my new wordpress I get this error: ‘The uploaded file exceeds the upload_max_filesize directive in php.ini.’

    Can I do anything about this?

  19. Kumar says

    Thank you! Wonderfully detailed step-by-step instructions. Was able to install WordPress on my local machine without a problem. Much appreciated.

  20. Julie says

    I am having the same problem James had:
    Hi! I have successfully installed my xamp server, wordpress and database. My question is, after logging in to wordpress, I cannot see any dashboard panel wherein I can edit my themes and install plugins. Please help! Thanks.

    Has anyone found a solution?
    Thanks!

  21. James says

    Hi! I have successfully installed my xamp server, wordpress and database. My question is, after logging in to wordpress, I cannot see any dashboard panel wherein I can edit my themes and install plugins. Please help! Thanks.

  22. Ruma says

    when I am submitting my data base name,username and password it is saying try again i have written each and every thing right name

  23. Dani says

    To anyone having an issue with the localhost/website1 link not working, how I got it to work (on mac, might work for windows) was heading over to the Network tab in XAMPP and pressing enable. Then I took the port number (in my case it was localhost:8080) and then added that to the url. It looked like localhost:8080/website1.

    Good luck!

    • Maria says

      Dani, Thanks so much for your post. I was having the same issue. After reading your post, I was able to get to the next step. few!

  24. Hillary says

    I have set up the WordPress website, but yet i am still having issues upload some plugins that come with the themes i want to use. How do i get to correct this?
    Thanks

  25. Nicholas says

    Thanks you so much ..
    But i have faced one problem, after putting WordPress files into htdocs, i went to my browser and searched for “localhost/WordPress ” and i got ” error 404 Object not found ” how can i please fix that problem?
    Thanks

    • Amokola Stephen says

      Did you start services in your local server(xamp)? if not please navigate xamp control panel and make sure that you start apache and mysql services

  26. Alexander says

    I really like your post, thank you for sharing such a great post. Setting up wordpress website on localhost using XAMPP is the best solution you have. It gives you an option to explore themes and plugins as well. When i was researching how to work on localhost i have found two great resources through which anyone can easily learn to launch wordpress using localhost.
    https://www.wpbeginner.com/wp-tutorials/how-to-create-a-local-wordpress-site-using-xampp/

  27. Aligo says

    Thank you very much for this article.. I really followed it and was successful in creating the website

  28. DavidA says

    Thank you for this article — it is great to be able to work at the website locally before exposing it to the world.

    Is it possible to have more than one website locally? I have another site that I need to modify/see locally. How would I add this to the other without getting them mixed?

    Thank you

  29. Trifina says

    For Mac users you recommended:

    “You will need to create this file in your website’s root folder.”

    Can you elaborate? Where can i find this folder?

  30. Ann says

    followed all the steps but when i put “localhost/website1”, it shows an error saying “Error establishing a database connection”, also tried restarting my xampp, yet still the same problem exist.

  31. Mike says

    Get an Object not found message when I put the localhost/website1 in my browser. It reads the following:

    Error 404

    localhost
    Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30

    Any ideas guys?

    Thanks

  32. Chris says

    good afternoon,
    thank you for your article. It was easy to follow. I have managed to install WP offline on my pc but I cannot figure out how to login to wp-admin and start working offline.
    I know you mentioned that we should login at /localhost/etc…. but where do I enter that? do I open it on my browser?

    thank you

  33. Amy says

    Hi, thanks for this great tutorial.
    I need to update the php.ini as I am getting the error ‘The uploaded file exceeds the upload_max_filesize directive in php.ini.’ how do I find this on localhost ?
    Thanks!

  34. Ratnesh Tripathi says

    Great article sir, but I am not able to login into WordPress admin panel.
    Please provide solution

  35. Mike says

    am not getting the welcome to word press page what’s wrong, it’s got — Index of /website1 —at the top

    • sam says

      Yeah, It happened to me too. You’ve gotta create your database name in the localhost/phpMyAdmin section in your browser before going back to fill the pieces of information and also the username will be root and the password will be empty. You’re good to go

  36. Shaedar says

    Thanks for the detailed guide… i followed the steps as outlined above an it all worked out well until i tried to launch wordpress on my browser by entering “localhost/website1” Instead of launching, its showed “Index/website1”
    please what could be the problem?

  37. Rodney Lacambra says

    Having a local WordPress site is great hence testing functionality, plugins, and themes before making it live.

    It’s also much faster compare to live.

    Thanks, great article.

  38. Paul Guzman says

    This worked to perfection. Can’t believe I actually did this. Instructions were “Right On”. This made my day!

  39. Soham Pratap says

    Much creative way to just design put up the content … experiment and when you are done!! get your site online

返信を残す

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