问题描述
MAMP 在启动 server 之前界面如下:
可以看到右上角的三个 server 旁边均是空心圆,其中 Cloud 旁边的空心圆只有使用付费版才会亮。点击 Sart Servers 之后,第一个空心圆会变亮几秒钟然后熄灭,第二个空心圆则始终没有亮,无法启动 server。整个过程没有报错。
我打开根目录下的日志文件 C:\MAMP\logs\apache_error.log,发现里面的记录如下:
[Sat Apr 20 12:24:40 2019] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Apr 20 12:24:41 2019] [notice] Digest: generating secret for digest authentication ...
[Sat Apr 20 12:24:41 2019] [notice] Digest: done
[Sat Apr 20 12:24:42 2019] [notice] Apache/2.2.31 (Win32) DAV/2 mod_ssl/2.2.31 OpenSSL/1.0.2h mod_fcgid/2.3.9 mod_wsgi/3.4 Python/2.7.6 PHP/7.2.10 mod_perl/2.0.8 Perl/v5.16.3 configured -- resuming normal operations
[Sat Apr 20 12:24:42 2019] [notice] Server built: May 6 2016 10:19:53
[Sat Apr 20 12:24:42 2019] [crit] (22)Invalid argument: Parent: Failed to create the child process.
[Sat Apr 20 12:24:42 2019] [crit] (OS 6)句柄无效。 : master_main: create child process failed. Exiting.
解决方法:
- 用记事本打开 C:\MAMP\conf\apache\httpd.conf
- Ctrl + F 查找到 LoadModule perl_module modules/mod_perl.so
- 在该行前面加上 # 与空格(将该行注释掉)
- 保存记事本,重启 MAMP
- 大功告成!MAMP可以启动 server,正常运行的界面如下: