https://www.apachefriends.org/jp/index.html
(XAMPP公式サイト)
PHP(プログラミング)の環境設定をするには、PHP、Webサーバ(Apacheとか)、MySQLなどをインストールしないといけないんですが、これらのWebサイトは英語表示だったりで色々めんどくさいです。
そこで、「そういうめんどいことをしたくない!」という人はXAMPPをインストールすると良いです。
XAMPPをインストールするだけでPHPに必要なソフトが全て揃います。
こういう神ソフトを提供してくれる人は本当に素晴らしいと思う。いや割とマジで。
インストールした後は適当に設定をイジればOKです。
まず、Apacheを起動するとPC内にWebサーバが作られることになり、そのままだと外部に見られてしまいます。そこで次のように設定します。
・エディタ(メモ帳でOK)でC:\xampp\apache\conf\httpd.confを開く
・<Directory "/xampp/htdocs">
・・・
Require all granted
</Directory>
を
<Directory "/xampp/htdocs">
・・・
#Require all granted
Require all denied
Allow from localhost 127.0.0.1
</Directory>
に書き換える
・<Directory "/xampp/cgi-bin">
AllowOverride All
Options None
Require all granted
</Directory>
を
<Directory "/xampp/cgi-bin">
AllowOverride All
Options None
#Require all granted
Require all denied
Allow from localhost 127.0.0.1
</Directory>
に書き換える
・パスワードを設定する
http://127.0.0.1/security/index.phpの
http://localhost/security/xamppsecurity.php
にアクセスしパスワードを設定
・C:\xampp\php\php.iniを開く
[mbstring]
; language for internal character representation.
; http://php.net/mbstring.language
;mbstring.language = Japanese
を
[mbstring]
; language for internal character representation.
; http://php.net/mbstring.language
mbstring.language = Japanese
に書き換える
これでひとまず完成です。
PHPファイルはC:\xampp\htdocsに保存し、
http://127.0.0.1/ファイル名
でアクセスできます。