Home Page Wordpress on Free MAMP does not work

2019-08-19 11:51发布

I have installed MAMP (free version) on my Mac and I see the Start Page but I have a problem:

I deployed wordpress but browser say unable to connect (basically I cannot see wordpress page in browser).

In Document Root if I put a static html file I am able to see it in the browser. I am also able to see wordpress administrative pages and all other pages but home page. I have 8888 and 8889 for php and mysql ports. I do not know how to debug the issues. php, apache and mysql do not report any particular problems.

I configured virtual hosts following this guide: http://foundationphp.com/tutorials/vhosts_mamp.php

The strange thing when I put http://localhost:8888/mywebsite in the browser it is redirected to localhost/mywebsite.

In /etc/hosts I have:

127.0.0.1 localhost

In httpd.conf I activated:

Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

and in this file I have:

NameVirtualHost *:8888

<VirtualHost *:8888>
    ServerAdmin myuser@gmail.com
    DocumentRoot "/Applications/MAMP/htdocs"
    ServerName localhost
    ErrorLog "logs/mywebsite-error_log"
    CustomLog "logs/mywebsite-access_log" common
</VirtualHost>

Hope someone could help.

1条回答
我命由我不由天
2楼-- · 2019-08-19 12:38

I found the solution. After several debugging I found that this guide is correct: http://foundationphp.com/tutorials/vhosts_mamp.php

You need: 1. In /etc/hosts add your virtual hosts like:

127.0.0.1 localhost
127.0.0.1 mywebsite

before I only used localhost because I hoped to use this host in browser but I found it's required to define a new host like mywebsite.

  1. In httpd.conf I activated:

    Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

  2. In this file I have:

    ServerAdmin myuser@gmail.com DocumentRoot "/Applications/MAMP/htdocs" ServerName mywebsite ErrorLog "logs/mywebsite-error_log" CustomLog "logs/mywebsite-access_log" common

查看更多
登录 后发表回答