New Install of ownCloud index.php Error in Browser

help

#1

This is my first experience with ownCloud server, so far I haven't been able to get it to work.
I'm installing at my hosting site, InMotion, using the software installer Softaculous. The install is shown as successful without any errors, however when I point to the URL I get a parse error with index.php.
Thanks for any help.

php version is 5.3
ownCloud version is 9.1.0
I'm installing is a subdomain, such as: cloud."mydomain".net.
I created the subdomain prior to install and point the installer Softaculous to that subdomain.

When pointing to my ownCloud URL the following error is shown:
Parse error: syntax error, unexpected '[' in /home/mensal5/public_html/cloud/index.php on line 42

I have removed the commented out lines from my index.php code below, it appears that the developer names in there were causing issues with me as a new forum member (restricted to two name mentions). Line 42 contains:
\OC::$server->getLogger()->logException($ex, ['app' => 'index']);

Below is my index.php:
<?php
/**
*names removed to allow posting this

// Show warning if a PHP version below 5.4.0 is used, this has to happen here
// because base.php will already use 5.4 syntax.
if (version_compare(PHP_VERSION, '5.4.0') === -1) {
echo 'This version of ownCloud requires at least PHP 5.4.0
';
echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.';
return;
}

try {

require_once 'lib/base.php';

OC::handleRequest();

} catch(\OC\ServiceUnavailableException $ex) {
\OC::$server->getLogger()->logException($ex, ['app' => 'index']);

//show the user a detailed error page
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
OC_Template::printExceptionErrorPage($ex);

} catch (\OC\HintException $ex) {
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
OC_Template::printErrorPage($ex->getMessage(), $ex->getHint());
} catch (Exception $ex) {
\OC::$server->getLogger()->logException($ex, ['app' => 'index']);

//show the user a detailed error page
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
OC_Template::printExceptionErrorPage($ex);

} catch (Error $ex) {
\OC::$server->getLogger()->logException($ex, ['app' => 'index']);
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
OC_Template::printExceptionErrorPage($ex);
}


#2

Hi,

ownCloud needs at least PHP 5.4 as the message is showing. This is also documented at doc.owncloud.org


#3

Hi
Thanks for the reply and spotting the issue.
For my first posting I wanted to make sure i didn't leave anything out or sound uber newbie, I guess that didn't go so well :blush: But, thank you. Now I'll see what it takes to get the right level of PHP at InMotion.