trampgeek / jobe

jobe is a server that runs small programming jobs in a variety of programming languages
MIT License
112 stars 79 forks source link

syntax error #24

Closed thopd88 closed 7 years ago

thopd88 commented 7 years ago

An error occurred when the test failed and I take a look to Apache log : PHP Parse error: syntax error, unexpected 'finally' (T_STRING), expecting catch (T_CATCH) in /var/www/html/jobe/application/controllers/restapi.php on line 228 System: CentOS 7 Installed: apache php libapache2-mod-php php-mcrypt mysql-server php-cli octave nodejs git python3 openjdk-9-jre python3-pip fp-compiler pylint3

trampgeek commented 7 years ago

Jobe requires php 5.5 or later.

-- Richard

thopd88 commented 7 years ago

Yes I installed php 7. I switched back to ubuntu then, but still dont undertand why we have this error

trampgeek commented 7 years ago

I don't understand either. The message:

PHP Parse error: syntax error, unexpected 'finally' (T_STRING), expecting catch (T_CATCH) in 
/var/www/html/jobe/application/controllers/restapi.php on line 228)

looks to me like it can only come from a version of PHP prior to 5.5. Can you please confirm what OS you're currently running on Jobe, the version of PHP it's using, what the output is from running the command

python3 simpletest.py

from within the jobe home directory, and what gets logged to the Apache error log while running that command.

thopd88 commented 7 years ago

I switched to Ubuntu Server after few hours try to fix it because of the urgency to use onlinejudge. The simpletest only output error because of the syntax error on restapi.php, nothing in the jobe home directory and the parse error is the only thing Apache logs recorded :(

On Oct 12, 2017, at 14:57, Richard Lobb notifications@github.com wrote:

I don't understand either. The message:

PHP Parse error: syntax error, unexpected 'finally' (T_STRING), expecting catch (T_CATCH) in /var/www/html/jobe/application/controllers/restapi.php on line 228) looks to me like it can only come from a version of PHP prior to 5.5. Can you please confirm what OS you're currently running on Jobe, the version of PHP it's using, what the output is from running the command

python3 simpletest.py from within the jobe home directory, and what gets logged to the Apache error log while running that command.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

trampgeek commented 7 years ago

What's the output from the command

php --version

?

thopd88 commented 7 years ago

I reinstalled the os so I don't know, but by that time I installed php on newest centos 7 with default command sudo yum install php php-mysql

On Oct 12, 2017, at 18:25, Richard Lobb notifications@github.com wrote:

What's the output from the command

php --version ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

trampgeek commented 7 years ago

Centos 7 apparently still comes with the outdated PHP 5.4. Your options:

  1. Don't use Centos. Ubuntu 16.04 is recommended.
  2. Upgrade PHP on Centos.
  3. Install Docker and run the Docker image of Jobe, JobeInABox

Richard