
前提・実現したいこと
macOSでMAMP上でphpファイルが表示したいです。
発生している問題・エラーメッセージ
macOSでMAMPで開発を行おうとしています。
hostsフォルダにphpファイルを置いてみましたが、phpファイルが表示されません。
8888ポートから、80ポート、81ポートに変更してみましたが、いずれもhostsフォルダに入れたファイルは表示されません。
現在81ポートにしていますが、
http://localhost:81/MAMP/で「Welcome to MAMP」のページは表示されます。
http://localhost:81/MAMP/a.phpは表示されません。
下記のように
Not Found The requested URL /MAMP/a.php was not found on this server.
になってしまいます。
他のポートにしてみた時の状態も同じです。
試したこと
ポートが競合しているのか確認してみましたが、競合していませんでした。
確認方法はサイトを参考に、ターミナルで確認しました。
MANPから停止してみたところ、特に何も表示されず、起動してみたところ表示されました。
考えられることとして、
元々XAMPPで行おうとしていたため、
https://teratail.com/questions/182553?sip=n0070000_019&uid=115193
httpd.conf ファイルとhttpd-vhosts.confファイルをいじったかもしれないです。
何か設定を変えた可能性があります。
すみませんが、何をしたか覚えていません。
設定ファイルのどこを変えたのか見当がつかず困っています。
https://qiita.com/leveloper8/items/c4f6a5d4897301e832a7
をみたと思います。
XAMPPのファイルは丸ごと消してしまいました。
phpファイル表示されない原因に考えられることに何がありますでしょうか?
何かヒントいただけると助かります。
/private/etc/apache2/extra/httpd-vhosts.conf の
httpd-vhosts.confですが、下記のようになっています。
何かおかしなところがありますでしょうか。
# Virtual Hosts # # Required modules: mod_log_config # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # <URL:http://httpd.apache.org/docs/2.4/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # <VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot "/usr/docs/dummy-host.example.com" ServerName dummy-host.example.com ServerAlias www.dummy-host.example.com ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log" CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@dummy-host2.example.com DocumentRoot "/usr/docs/dummy-host2.example.com" ServerName dummy-host2.example.com ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log" CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common </VirtualHost>
補足情報(FW/ツールのバージョンなど)
macOS Sierra 10.12.6
MAMPバージョン 5.3
回答1件
あなたの回答
tips
プレビュー