Mamp无法启动apache(Windows 10) - php

我本周已经在Windows 10计算机上安装了MAMP Pro,并且直到今天都工作正常。我重新启动计算机,然后立即启动了MAMP Pro-这导致MySQL服务器启动,但Apache无法启动。然后,我重新启动了MAMP,并且没有服务器在运行,我检查了MAMP端口上是否还有其他服务正在运行,但没有。我还更改了MAMP中的端口,但是它也不起作用。

为什么会这样呢?

这是Apache日志:

[Sat Oct 21 04:46:43 2017] [warn] pid file C:/MAMP/bin/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

[Sat Oct 21 04:46:43 2017] [notice] Digest: generating secret for digest authentication ...

[Sat Oct 21 04:46:43 2017] [notice] Digest: done

[Sat Oct 21 04:46:44 2017] [notice] Apache/2.2.31 (Win32) DAV/2 mod_ssl/2.2.31 OpenSSL/1.0.2e mod_fcgid/2.3.9 mod_wsgi/3.4 Python/2.7.6 PHP/7.1.5 

mod_perl/2.0.8 Perl/v5.16.3 configured -- resuming normal operations

[Sat Oct 21 04:46:44 2017] [notice] Server built: May  6 2016 10:19:53

[Sat Oct 21 04:46:44 2017] [notice] Parent: Created child process 5348

[Sat Oct 21 04:46:45 2017] [notice] Digest: generating secret for digest authentication ...

[Sat Oct 21 04:46:45 2017] [notice] Digest: done

[Sat Oct 21 04:46:46 2017] [notice] Child 5348: Child process is running

[Sat Oct 21 04:46:46 2017] [notice] Child 5348: Acquired the start mutex.

[Sat Oct 21 04:46:46 2017] [notice] Child 5348: Starting 64 worker threads.

[Sat Oct 21 04:46:46 2017] [notice] Child 5348: Starting thread to listen on port 443.

[Sat Oct 21 04:46:46 2017] [notice] Child 5348: Starting thread to listen on port 443.

[Sat Oct 21 04:46:46 2017] [notice] Child 5348: Starting thread to listen on port 80.

参考方案

请执行下列操作:
MAMP->首选项-> PHP。将标准版本7.3.7更改为7.2.14。启动服务器。
成功后,您可以返回标准版本7.3.7。

PHP getallheaders替代 - php

我正在尝试从服务器上的apache切换到nginx。唯一的问题是我在PHP脚本中使用的getallheaders()函数,该函数不适用于Nginx。我已经尝试过用户在getallheaders函数上的php站点上提供的注释,但这并不返回所有请求标头。请告诉我如何解决这个问题。我真的想切换到Nginx。 参考方案 您仍然可以使用它,但是您必须像这里一样重新定义…

php Singleton类实例将在多个会话中保留吗? - php

举一个简单的例子,如果我想计算一个不使用磁盘存储的脚本的命中次数,我可以使用静态类成员来执行此操作吗?用户1:<?php $test = Example::singleton(); $test->visits++; ?> 用户2:<?php $test = Example::singleton(); $test->visits+…

PHP:将字符串拆分为字母和数字部分的最佳方法 - php

我有几个格式的字符串AA11 AAAAAA1111111 AA1111111 分离字符串的字母和数字部分的最佳方法(最有效)? 参考方案 如果它们都是一系列字母,然后是一系列数字,并且没有非字母数字字符,那么sscanf()可能比regexp更有效$example = 'AAA11111'; list($alpha,$numeric) =…

php-casperjs获取内部文本 - php

我正在为casperjs使用php包装器-https://github.com/alwex/php-casperjs我正在网上自动化一些重复的工作,我需要访问一个项目的innerText,但是我尚不清楚如何从casperjs浏览器访问dom。我认为在js中我会var arr = document.querySelector('label.input…

PHP strtotime困境 - php

有人可以解释为什么这在我的服务器上输出为true吗?date_default_timezone_set('Europe/Bucharest'); var_dump( strtotime('29.03.2015 03:00', time()) === strtotime('29.03.2015 04:00�…