ウェブ家の備忘録

ウェブデザイナーの備忘録

Xamppで仮想サーバー立ててWordPressをする方法

下準備

やり方

 個人的にはWordPressのバージョンは4.Xと5.Xを導入したい。
 済んだら下記のニュアンスのbatファイルを作成。作業開始時に起動。 

WordPressテーマ作成.bat


@ECHO OFF
echo WordPressテーマ作成
start "" "C:\xampp\xampp-control.exe"
echo xamppのApacheとMySQLを手動で実行してください

SET /P selected="phpMyAdminは使われますか?(Y/N)"
if /i {%selected%}=={y} (goto :yes)
if /i {%selected%}=={yes} (goto :yes)
:no
goto exitlabel
:yes
start "" "http://localhost/phpmyadmin/"
:exitlabel

start "" "http://localhost/wordpress/"
start "" "http://localhost/wordpress/admin/"
start "" "C:\xampp\htdocs\wordpress\wp-content\themes"
exit


WordPressテーマ作成[WP4・WP5選択].bat


@ECHO OFF
echo ローカルxampp
echo WordPress
start "" "C:\xampp\xampp-control.exe"
echo xamppのApacheとMySQLを手動で実行してください

SET /P selected="phpMyAdminは使われますか?(Y/N or Anykey)"
if /i {%selected%}=={y} (goto :yes)
if /i {%selected%}=={yes} (goto :yes)
:no
goto exitlabel
:yes
start "" "http://localhost/phpmyadmin/"
:exitlabel


SET /P selected="実行選択 ■WP4のみ(4) ■WP5のみ(5) ■両方(anykey)"
if /i {%selected%}=={4} (goto :wp4)
if /i {%selected%}=={5} (goto :wp5)
:etc
start "" "http://localhost/wp4/admin/"
start "" "http://localhost/wp4/"
start "" "http://localhost/wp5/admin/"
start "" "http://localhost/wp5/"
start "" "C:\xampp\htdocs\wp4\wp-content\themes"
start "" "C:\xampp\htdocs\wp5\wp-content\themes"
goto exitlabel
:wp4
start "" "http://localhost/wp4/admin/"
start "" "http://localhost/wp4/"
start "" "C:\xampp\htdocs\wp4\wp-content\themes"
goto exitlabel
:wp5
start "" "http://localhost/wp5/admin/"
start "" "http://localhost/wp5/"
start "" "C:\xampp\htdocs\wp5\wp-content\themes"
:exitlabel

exit