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

369 views Asked by At

I hope that all is well with you all.

I was following Gregor Gramlich's tutorial from http://ggramlich.github.io/phpslim/installation.html to http://ggramlich.github.io/phpslim/first_test.html. I was using phpslim.phar from that tutorial. And then I was using FitNesse of release 20161106.

So I have a problem after I hit the Test button. FitNesse give me a warning:

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

Then I clicked the Execution Log button. The Standard Output give me a description:

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

I was using port 8070 when starting the FitNesse. I was using Lubuntu 12.04, PHP 5.3 and Java 1.7 (OpenJDK 7).

Would you all telling me how to solve this problem?

Thank you.

1

There are 1 answers

0
ramsey051991 On BEST ANSWER

Everyone, I have found the answer for this problem. So I was actually asked this question in the GitHub page of PhpSlim. Mr. Gramlich is the one who answered this problem. You can see the detail here.

I can successfully run the MyFirstSlimTest from Mr. Gramlich's tutorial in my PhpSlim now.

I only need to change the java command from

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

to

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