Before you read this post, this is my first post and I am 16 years of age so please don't jump the gun if this is something that you guys are already aware of.
Although, I downloaded OrangeHRM today and installed it on to my web server (fresh install) and the installation went successful. However, after installing the script I couldn't physically use the script as the script was returning me to an error page which stated "Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ']'"
I researched in to this and people said it was because I needed to upgrade my PHP version although, after tampering with the code I found a solution without the need to upgrade.
The actual error was being outputted from line 65 within the "orangehrmPostExecutionFilter.php".
Can be found in: "/symfony/plugins/orangehrmCorePlugin/lib/filter"
The way I resolved the parse error was by locating line 65 within the file above and you should notice this syntax of code:
- Code: Select all
}
if (isset($messages[$serviceInstance::getState()])) {
MessageRegistry::instance()addMessage($messages[$serviceInstance::getState()], $module, $action);
}
The way I fixed this issue was by making the following modification below:
- Code: Select all
}
if (isset($messages[$serviceInstance->getState()])) {
MessageRegistry::instance();addMessage($messages[$serviceInstance->getState()], $module, $action);
}
I replaced $serviceInstance::getState() with $serviceInstance->getState() and also on the line underneath I added a semi-colon after the function called Instance()
Finally, on the same line once again I replaced [$serviceInstance::getState()] to [$serviceInstance->getState()]
and boom I re-uploaded the file and the script now works!
I hope this comes in useful for people how have this error when attempting to log-in to the script for the first time after the installation process.
Many thanks,
Joshua Walker.
