Koozali.org: home of the SME Server

Obsolete Releases => SME 9.x Contribs => Topic started by: ozhank on September 22, 2018, 05:14:42 AM

Title: OrangeHRM
Post by: ozhank on September 22, 2018, 05:14:42 AM
The wiki instructions are outdated - is there someplace I can find how to install the lastest version? Needed fairly urgently for aged care facility.
Title: Re: OrangeHRM
Post by: ReetP on September 22, 2018, 11:01:02 PM
Don't just expect everyone to do all the work for you, especially as I guess you will earn money from this, not us.

If you want urgent then you'll need to get your wallet out and pay someone. We're all volunteers here, it's the weekend, and we'll help as and when we can.

As I presume you don't want to pay someone you can do a lot to help yourself by doing some homework.

The wiki should give you a starter.

Their forums should have minimum installation requirements.

Then check the wiki again where you will probably find information that you require eg installing a newer version of PHP etc.

When you have done all that and you are stuck with installing it, come back with a proper description of what the requirements are and what you have attempted to do, and if you are lucky someone may try and help you.

And once you have it running you can contribute back by updating the wiki.

Thank you.
Title: Re: OrangeHRM
Post by: ozhank on September 23, 2018, 02:54:00 AM
I think as a  moderator, you have done the forum an injustice and made some wrong assumptions about me.

Just to explain a few things. I have read the wiki. In the past I have contributed to the wiki. I have made donations.

This installation is for an aged care facility to meet government audit requirements, and I am not making a brass razoo (ie nothing, zip, nada) as I do for all the non-for-profit organisations I happen to come across. I am time pressed as the government audit requirements have to be met within the next few days and I thought there might be someone here who had successfully installed and could/would help me out or had some ideas. Once I do get it working, I will organise a wiki account and update the wiki as I dislike working with outdated documentation.

So far:
[/list]
Title: Re: OrangeHRM
Post by: TerryF on September 23, 2018, 11:52:24 AM
Well standard sme9.2 aint up to it for the latest version:

Server Hardware/Software Requirements
Processor - Intel Xeon 2.2GHz (Or equivalent AMD processor) higher 
Memory - 4 GB or higher 
Hard Disk - 100 GB or higher 
Apache HTTP Server 2.2.22 or later 
MySQL 5.5 or later 
PHP 5.4 or later
Title: Re: OrangeHRM
Post by: TerryF on September 23, 2018, 12:13:44 PM
There is a docker image see https://hub.docker.com/r/orangehrm/orangehrm/

Might be worth a play

Added: unfortunately its for Debian
Title: Re: OrangeHRM
Post by: ReetP on September 23, 2018, 03:49:08 PM
I think as a  moderator, you have done the forum an injustice and made some wrong assumptions about me.

Just to explain a few things. I have read the wiki. In the past I have contributed to the wiki. I have made donations.


In that case I apologise as you only have a single post to your name..... regrettably I've seen far too many first time posters who want 'urgent' help and expect everyone to stop their social life to help them.

Quote
This installation is for an aged care facility to meet government audit requirements, and I am not making a brass razoo (ie nothing, zip, nada) as I do for all the non-for-profit organisations I happen to come across. I am time pressed as the government audit requirements have to be met within the next few days and I thought there might be someone here who had successfully installed and could/would help me out or had some ideas. Once I do get it working, I will organise a wiki account and update the wiki as I dislike working with outdated documentation.

Fine, but equally I can't imagine that the organisations concerned didn't know about this some time ago. Just because it is 'urgent' for them doesn't mean it is urgent for anyone else.

I am surprised that if you have edited the wiki before that you haven't still got your login?

Quote
So far:
  • searched wiki and forums
  • found some forum instructions and followed them
  • download the latest orangehrm from sourceforge
  • created ibay named orangehrm
  • unzipped orangehrm into html folder
  • attempted to access as per previous instructions, but no joy. Will now look at what version php running
[/list]

Didn't seem to find the minimum requirements which really is the most important part. Without that, everything else is really a waste of time.

As it transpires, Terry has kindly done the work for you and it appears that you need a minimum of PHP 5.4 - which in reality means 5.6 as 5.4 is EOL.

You also need MySQL 5.5

So your next step before you installed anything was to add PHP 5.6 and MySQL 5.5

Armed with that information a search in the wiki would have revealed:

https://wiki.contribs.org/PHP_Software_Collections

I'd suggest installing 5.6 for the whole server as it is probably easier.

MySQL is here:

https://wiki.contribs.org/Software_Collections:MySQL55

Note the comment about using '127.0.0.1' instead of 'localhost'

After that, assuming you have enough horsepower, it should just run.

Title: Re: OrangeHRM
Post by: ReetP on September 23, 2018, 04:12:18 PM
There is a docker image see https://hub.docker.com/r/orangehrm/orangehrm/

Might be worth a play

Added: unfortunately its for Debian

Docker itself is installable on SME. It is OS 'ambivalent' - I have it running my Rocketchat. I have a hubot and samba 4 both running in Alpine, on docker on SME. You can run all sorts of OSs in a container. That's the point of containerisation :-)

There are some caveats though.


Yes I am sure it is possible. Needs a bit of work though.
Title: Re: OrangeHRM
Post by: michelandre on September 23, 2018, 05:26:23 PM
Hi ozhank,

SME Server-9.2 / all updated. I have php70 installed.

I tried all kind of things to install it with no luck.

I found: https://www.linuxhelp.com/how-to-install-orangehrm-on-centos-6-9/

I tried: wget http://nchc.dl.sourceforge.net/project/orangehrm/stable/3.3.2/orangehrm-3.3.2.zip

I had to ajust a few write permissions and it installed OK. But I think I need a Let's Encrypt certificate to be able to login.

Michel-André

PS: With mysql55 and also with 127.0.0.1 didn't work.
Title: Re: OrangeHRM
Post by: ReetP on September 23, 2018, 05:50:13 PM
Quote
PS: With mysql55 and also with 127.0.0.1 didn't work.

If you read carefully it defaults to a socket only connection.

E.g. localhost:/var/lib/mysql/mysql55.sock

As per the wiki, to use a port you have to set LocalNetworkingOnly no

And then use 127.0.0.1:3307

Title: Re: OrangeHRM
Post by: mmccarn on September 23, 2018, 06:24:47 PM
For what it's worth -

I've tried for 2 - 4 hours now to get OrangeHRM installed on SME9.2 without success.

I was unable to find any combination of sockets, ports, php, or mysql versions that would allow the orangehrm installer to complete "normally" (NOTE: after any failed installation attempt, you need to clear your BROWSER cache before re-trying. I have never seen this in another web app installer...)

I was able to get OrangeHRM installed manually (create ibay, configure to use php71, customize php.ini for php71 to use mysql55 for both mysqli and pdo_mysql, configure mysql55 to use port 3306 in case the bug in the OHRM installer is related to the mysql port, create the database manually, load the tables and default data using OHRM/dbscripts/dbscript-1.sql and OHTM/dbscripts/dbscript-2.sql, create  OHRM/lib/confs/Conf.php based on OHRM/lib/confs/Conf.php-distribution, insert the database details, then run the OHRM web updater) but that procedure leaves you with no user accounts, so you can't login (unless you write a custom php script to generate a password hash to insert manually into the user table).

Installer problems with OHRM go back to 2009, and the responses I saw from the devs look like "use the paid version".

My recommendation is to find an all-in-one installer rather than try to figure out how the apparently fragile and under-documented OHRM installer works.

Bitnami (https://bitnami.com/stack/orangehrm/installer) has the current version of orangehrm available in many formats.

Title: Re: OrangeHRM
Post by: ReetP on September 23, 2018, 07:00:29 PM
For what it's worth -
I've tried for 2 - 4 hours now to get OrangeHRM installed on SME9.2 without success.

Above and beyond :-)

Ugly then....... a web app should not be that difficult.

Any major log errors ? Any suggestions in their foros ?
Title: Re: OrangeHRM
Post by: mmccarn on September 23, 2018, 07:14:48 PM
The consistent error in the log is that the database does not exist, whether I'm inputting 'root' credentials and letting the installer create the database or whether I pre-create the database. 

When I use a pre-created database there is an earlier stage in the installer that fails if the database does not exist with the proper database user credentials, but even then the step where the tables are created and initial data loaded give an error about connecting to the database.

I couldn't find any (simple) instructions on enabling debug logging for the OHRM installer -- so all I see is an error about a missing database (I've deleted the ibay and all contents, so I can't lookup the exact error any more).

The disconnect between the earlier database connect stage (that passes) and the subsequent stage (that fails) is what convinced me that the installer itself is too fragile for me to get worked up about ;-)  I'm sure there is some host configuration where their installer works, but it is not Centos 6 with SCL php and SCL mysql...

All I found in the OHRM forums was the note I mentioned from 2009 from someone getting the same error I was getting.  The suggestion was to use the 30 day eval of the paid version.
Title: Re: OrangeHRM
Post by: ReetP on September 23, 2018, 07:22:13 PM
I can try a test install & step debug it but not for a day ot two as I've been away last week and thunderstorms have wrecked a load of kit so running on wings & prayers right now !!
Title: Re: OrangeHRM
Post by: TerryF on September 23, 2018, 11:23:59 PM
For what it's worth -
I've tried for 2 - 4 hours now to get OrangeHRM installed on SME9.2 without success.

I gave up with the MySQL issues as with you tried manually and the underwhelming OHRM installer..have been doodling with the docker image but dumped it as well, to much mucking about to be considered a quick setup for a "Non-Profit"

Note: just adding some background, Oz Gov last week or so appointed a Royal Commission to investigate the Aged Care industry, considering what has been revealed in recent investigations every facility will be to be polite, a little concerned, having had to place both of my parents in Aged Care here in Oz last two years, there is no such thing as a Not For Profit aged care org...
Title: Re: OrangeHRM
Post by: TerryF on September 24, 2018, 09:12:41 AM
Using SME10: Got it to at least create the db but php ver is still to old for latest OrangeHRM even though the requirements on their website said PHP 5.4 or later, it seems its is actually 5.6 or later
Title: Re: OrangeHRM
Post by: ReetP on September 24, 2018, 02:15:16 PM
OK,

I've been step debugging through the installer this morning.

What a complete horror story.

First thing is in the install.php file (my comments)

Code: [Select]
// These are the same and this is what causes the issue
                //$errorMsg = mysqli_error($conn); // this is set to an empty string but should be uninitialized/unset or it gets picked up by the error routines
                //$mysqlErrNo = mysqli_errorno($conn); // this is unset - should be mysqli_errno


This should be something like:

Code: [Select]
                if (mysqli_error($conn)){
                    $errorMsg = mysqli_error($conn);
                }
                if (mysqli_errno($conn)){
                    $mysqlErrNo = mysqli_errno($conn);
                }

You then get $SESSION['DBINFO'] = OK so we have connected to the DB OK, but still fails.

That's when it goes running off to do a system validation.

Look at the code here that is called from checkSystem.php:

Code: [Select]
    private function getMySqlVersion($host, $userName, $password)
    {
        $mysqli = new mysqli($host, $userName, $password);

        if (mysqli_connect_errno()) {
            printf("Connect failed: %s\n", mysqli_connect_error());
            exit();
        }
        $currentVersion = $mysqli->server_info;

        $mysqli->close();
        return $currentVersion;
    }

So where is the port?? checkSystem.php has the correct DB details:

Code: [Select]
$conn = @mysqli_connect($dbInfo['dbHostName'], $dbInfo['dbUserName'], $dbInfo['dbPassword'], "", $dbInfo['dbHostPort']))

But it fails to send them to the validation as it uses this line:

Code: [Select]
$systemValidator->isMySqlCompatible($dbInfo['dbHostName'], $dbInfo['dbUserName'], $dbInfo['dbPassword']))
Without the correct port etc you get Access denied. <slapshead>

Essentially they give you the option to use a different port or use a socket, and then completely ignore it all.

As a result there are other functions in there that would also need hacking.

I haven't bothered to go any further. I don't have the time, and am not getting paid to do this.

Yes, I am sure I could get it installed. Just needs stepping through and fixing the broken bits, of which there are plenty - I had to override some other hard coded $vars etc etc as well. Probably a good day or two of work as I am sure there will be other issues in there when you actually run it.

However, if that is the standard of their installer, I don't hold much hope for the rest of their spaghetti code....

(remember I am NOT a coder. Just happen to be handy at debugging)