为什么我点击测试按钮后我的 PhpSlim 不能在 FitNesse 中 运行?

Why my PhpSlim cannot run in FitNesse after I hit the Test button?

希望大家一切都好

我正在关注 http://ggramlich.github.io/phpslim/installation.html to http://ggramlich.github.io/phpslim/first_test.html 中 Gregor Gramlich 的教程。我正在使用该教程中的 phpslim.phar。然后我使用了 20161106 版的 FitNesse。

所以我在点击“测试”按钮后遇到了问题。 FitNesse 给我一个警告:

Unable to start test system 'slim': fitnesse.slim.SlimError: Got invalid slim header from client. Read the following:

然后我点击了执行日志按钮。标准输出给我一个描述:

PHP Warning:  socket_bind(): unable to bind address [13]: Permission denied in phar:///home/lubuntu/Documents/Time/phpslim.phar/PhpSlim/SocketService.php on line 14
PHP Fatal error:  Uncaught exception 'PhpSlim_SlimError' with message 'socket_bind() failed: Permission denied' in phar:///home/lubuntu/Documents/Time/phpslim.phar/PhpSlim/Socket.php:135
Stack trace:
#0 phar:///home/lubuntu/Documents/Time/phpslim.phar/PhpSlim/SocketService.php(16): PhpSlim_Socket->raiseError('socket_bind() f...')
#1 phar:///home/lubuntu/Documents/Time/phpslim.phar/PhpSlim/SocketService.php(6): PhpSlim_SocketService->bind()
#2 phar:///home/lubuntu/Documents/Time/phpslim.phar/PhpSlim/Server.php(24): PhpSlim_SocketService->init()
#3 phar:///home/lubuntu/Documents/Time/phpslim.phar/PhpSlim.php(29): PhpSlim_Server->run('1')
#4 phar:///home/lubuntu/Documents/Time/phpslim.phar/index.php(4): PhpSlim::main(Array)
#5 /home/lubuntu/Documents/Time/phpslim.phar(9): include('phar:///home/lu...')
#6 {main}
  thrown in phar:///home/lubuntu/Documents/Time/phpslim.phar/PhpSlim/Socket.php on line 135

我在启动 FitNesse 时使用了端口 8070。我使用的是 Lubuntu 12.04、PHP 5.3 和 Java 1.7 (OpenJDK 7)。

你们能告诉我如何解决这个问题吗?

谢谢。

各位,我已经找到这个问题的答案了。所以我实际上是在 PhpSlim 的 GitHub 页面中被问到这个问题的。 Gramlich 先生就是回答这个问题的人。 You can see the detail here.

我现在可以在我的 PhpSlim 中成功 运行 Gramlich 先生教程中的 MyFirstSlimTest。

我只需要将 java 命令从

更改为
java -jar fitnesse-standalone.jar -e 0 -p 8070 -d /path/to/project

java -Dslim.port=0 -jar fitnesse-standalone.jar -e 0 -p 8070 -d /path/to/project