Mac OS利用Composer安装的ThinkPHP遇到404 Not Found The requested URL was not found on this server问题

有关Composer安装ThinkPHP的详细过程不再重复,主要针对运行http://localhost/tp5/public/出现404 Not Found The requested URL was not found on this server.的问题,
问题如下图所示:
Mac OS利用Composer安装的ThinkPHP遇到404 Not Found The requested URL was not found on this server问题
解决办法:出现上面这个问题主要是因为ThinkPHP的安装文件与Web服务器的根目录不符,Mac的Apache服务器默认的web根目录在:/Library/WebServer/Documents,只需要将tp5文件(ThinkPHP的安装文件)移动到Apache服务器默认的web根目录下就可以解决问题啦,出现下图即解决问题:
Mac OS利用Composer安装的ThinkPHP遇到404 Not Found The requested URL was not found on this server问题