2017-10-18 94 views
0

我正在使用最新的OS X Sierra 10.12.6,XAMPP 7.1.9和PHP 7.1,我安装了最新的Homebrew/homebrew-核心(git修订版7598;最后一次提交2017-10-18)来实现此目标:使用最新的mongodb扩展名(即替换旧的mongo扩展名)。OS X Sierra + XAMPP 7.1.9-0 +扩展mongodb.so不是开始

干净后安装的MongoDB这样的:

brew tap homebrew/php 
brew install php71-mongodb 

我发现MongoDB的扩展:

/usr/local/opt/php71-mongodb/mongodb.so 

我加入到我的XAMPP安装的php.ini文件: /应用/ XAMPP/xamppfiles /等

extension="/usr/local/opt/php71-mongodb/mongodb.so" 

之后,我要重新启动XAMPP分别Apache2的服务: /Applications/XAMPP/xamppfiles/ctlscript.sh重启Apache

我唯一能收到的反应是什么,但一个错误:

AH00548: NameVirtualHost has no effect and will be removed in the next release /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf:40 Syntax OK /Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : apache not running AH00548: NameVirtualHost has no effect and will be removed in the next release /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf:40 Syntax OK /Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd started

奇怪的从这里开始:

当我使用的XAMPP用户界面重新启动该服务,Apache2的不工作了。

即使在CLI上重新启动服务将解决此问题。

即使从php.ini中删除对mongodb.so的引用后将修复此问题。

问题是:我没有收到任何类型的错误。不在/Applications/XAMPP/xamppfiles/logs/php_error.log也不在/Applications/XAMPP/xamppfiles/logs/error.log

回答

0

见下文

更新我找到了一种方法来重新启动与工作的MongoDB扩展该线程中的Apache2服务:

​​3210

重新启动使用该命令对CLI服务帮助我:

/Applications/XAMPP/xamppfiles/bin/httpd -E /Applications/XAMPP/xamppfiles/logs/error_log 

那就是所有。

但我仍然不要了解所有这些是如何连接的。当再次使用XAMPP UI重新启动时,它再次无法工作。但UI在一开始就确实有效。所以,不知何故安装了mongodb文件(或者可能是自制软件)在XAMPP安装中的某处损坏了某些东西。

更新,第二天

我安装了一个新的XAMPP,从划伤 过了好一会儿找出来,什么XAMPP UI确实启动了Apache,这是命令的链条:

/Applications/XAMPP/xamppfiles/ctlscript.sh start apache 
-> 
/Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh start 
-> 
/Applications/XAMPP/xamppfiles/xampp startapache 
-> 
/Applications/XAMPP/xamppfiles/bin/apachectl -k start -E /Applications/XAMPP/xamppfiles/logs/error_log -DSSL -DPHP 
-> 
/Applications/XAMPP/xamppfiles/bin/httpd -k start -E /Applications/XAMPP/xamppfiles/logs/error_log -DSSL -DPHP 

之后,我将着名的mongodb.so-line添加到php.ini文件中。

从现在起,我无法再使用UI再次启动Apache。所以,我从上面的链带的最后一个命令并执行它,这个结果:

(13)Permission denied: AH00086: httpd: could not open error log file /Applications/XAMPP/xamppfiles/logs/error_log. AH00548: NameVirtualHost has no effect and will be removed in the next release /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf:40 (13)Permission denied: AH00072: make_sock: could not bind to address [::]:80 (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down AH00015: Unable to open logs

结果#1:只需添加扩展在php.ini从错误类型的删除写标志。登录

所以,这很容易与

sudo chmod a+w /Applications/XAMPP/xamppfiles/logs/error_log. 

修复现在,在这个问题上的历史上还是第一次,我从error.log中一个真正的错误信息,那就是告诉的东西我:

(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80 (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down AH00015: Unable to open logs

结果#2:启动Apache作为命令行须藤将修复它

剩余mysterys

它仍然是不明确的,以我的,添加扩展到PHP之后会发生什么。 INI。即使删除它也不能解决问题。