I suspect you might be invoking the wrong version of PHP via the command line. I noticed that you have your instance installed in /opt/lampp, which leads me to believe you used some sort of pre-packaged bundle to install Apache + PHP which Sugar uses.

However, when you go to the command line, executing "php" would run the version of PHP in your path, not the one in your LAMP package/bundle.

What do you get if you run "php -v" ? Does it return the same version of PHP as what Sugar is using?