ElkArte Community

Project Support => Support => Topic started by: thesohogeek on July 06, 2018, 12:54:40 pm

Title: PHP version reporting incorrectly...
Post by: thesohogeek on July 06, 2018, 12:54:40 pm
This as the install completes:

You do not appear to have a version of PHP installed on your webserver that meets ElkArte's minimum installations requirements.

phpinfo reports:

PHP Version 5.4.45-1~dotdeb+7.1

command line reports:

php -v
PHP 5.4.45-1~dotdeb+7.1 (cli) (built: Sep  4 2015 23:38:46)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

Minimum requirements state > 5.2

So what's the deal guys? Can I run this please...

I've spent hours trying to find a self-hosted, responsive (yay - Bootstrap!), PHP/MySQL discussion forum that looks good, can can be easily skinned, only to hit the buffers. Where's this test carried out - can I obliterate it please???

I guess the dot deb build might be confusing your checks?

thanks
TSG


Title: Re: PHP version reporting incorrectly...
Post by: emanuele on July 06, 2018, 01:13:26 pm
The test is done comparing the required version with the native constant PHP_VERSION that is defined by PHP itself.
Out of curiosity, would you mind reporting the value of this constant?
For example:
Code: [Select]
php -r "echo PHP_VERSION;"
Title: Re: PHP version reporting incorrectly...
Post by: thesohogeek on July 06, 2018, 01:31:15 pm
~# php -r "echo PHP_VERSION;"
5.4.45-1~dotdeb+7.1<redacted as irrelevant>

;-)

Title: Re: PHP version reporting incorrectly...
Post by: thesohogeek on July 06, 2018, 01:34:08 pm
Incidentally, the host VM was due an upgrade so I cloned the container, and then while I was about it I removed the dot deb package, and the pinning etc. and did a dist-upgrade (to Jessie) on my new cloned container. I now have 5.6.36... (official Debian pkg) and it's producing exactly the same error on trying to load the forum... ???
Title: Re: PHP version reporting incorrectly...
Post by: tino on July 06, 2018, 01:46:29 pm
Can you 'echo PHP_VERSION' in an web page? I have it installed on debian using jessie and stretch along with sid, with no issues.

QuotePHP 7.0.27-0+deb9u1 (cli) (built: Jan  5 2018 13:51:52) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.27-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies
Title: Re: PHP version reporting incorrectly...
Post by: thesohogeek on July 06, 2018, 02:00:06 pm
& 5.4.45-1~dotdeb+7.1 comes right back at you...

I've checked php.ini to make sure none of the other dependencies are wrong - tons of headroom on all the size limits, the appropriate extensions (bcmath and gd) are there and running...

???
Title: Re: PHP version reporting incorrectly...
Post by: thesohogeek on July 06, 2018, 02:00:51 pm
If you can email me, I'll send you the URL so you can see for yourself... ;-)
Title: Re: PHP version reporting incorrectly...
Post by: tino on July 06, 2018, 02:19:08 pm
Quote from: thesohogeek – If you can email me, I'll send you the URL so you can see for yourself... ;-)

Are you installing from the Github Master or the the package available: https://github.com/elkarte/Elkarte/releases/download/v1.1.4/ElkArte_v1-1-4_install.zip
Title: Re: PHP version reporting incorrectly...
Post by: thesohogeek on July 06, 2018, 02:21:31 pm
I was using Github master, but I'm now downloading this version 1.1.4 and will let you know what happens...
Title: Re: PHP version reporting incorrectly...
Post by: thesohogeek on July 06, 2018, 02:39:19 pm
OK, so now it doesn't complain about the PHP version, but instead tells me that my db user doesn't have ALTER, CREATE & DROP privileges.

The db user has database wide permissions for everything except GRANT. No global permissions of course, as is standard.

So what does this error message mean. Again, not what it says I think? Any ideas what is really going on here - this is a dead simple nginx / php5-fpm server that's running a load of PHP websites without issue... ???

I'm stumped.

Title: Re: PHP version reporting incorrectly...
Post by: thesohogeek on July 06, 2018, 02:41:51 pm
PS - the self-same db user accessed the empty db ( I dropped all the tables from previous attempts before starting this 1.1.4 install) without any complaint, and I can see all the tables etc. created by the installer, so I think CREATE works !!!
Title: Re: PHP version reporting incorrectly...
Post by: tino on July 06, 2018, 02:44:19 pm
Quote from: thesohogeek – So what does this error message mean.

It only throws this error if the ALTER command fails. Can you check the user privileges?

What database tables do you have in your database, if any, primarily this one is used to test the ALTER command against "log_digest"
Title: Re: PHP version reporting incorrectly...
Post by: thesohogeek on July 06, 2018, 04:08:43 pm
I'm afraid I'm giving up at this point. Needless to say, the privileges are all set correctly and have been throughout and yes, the log_digest table was correctly created on install, and so the worry for me is that the logic is clearly there but all these errors leave me with no confidence that we can use this live.

I asked earlier if you could tell me where these checks are being performed, because I'm perfectly prepared to get into the PHP and sort this out for myself if needs be... but without that info I've really not got time to go hunting through to find it.

Simply turning them off might even just result in a working solution - perhaps you're setting timeouts to short or something? I don't know, all I know is that a system that announces that the user cannot CREATE when they have just done so has to be a bit lame!!! Can I not get this running and then test it myself?
Title: Re: PHP version reporting incorrectly...
Post by: thesohogeek on July 06, 2018, 04:12:27 pm
OK, we're at line 1883 etc. in /install/upgrade.php - now to figure this out... stay tuned...
Title: Re: PHP version reporting incorrectly...
Post by: thesohogeek on July 06, 2018, 04:22:22 pm
OK, so all this is doing is upgrading the db from a previous schema to the required one for 1.1.4. So you can send me a clean, empty db at 1.1.4 which doesn't need upgrading and then we can bypass this completely?
Title: Re: PHP version reporting incorrectly...
Post by: tino on July 06, 2018, 04:53:59 pm
Why are you running upgrade.php? It should be install.php if you're installing a new forum.

I am only going on GitHub and looking at the code btw, I didn't write this software just trying to assist.
Title: Re: PHP version reporting incorrectly...
Post by: thesohogeek on July 06, 2018, 05:16:06 pm
As far as I can see the installer runs and then goes straight on to upgrade.php - it does seem odd that the latest version requires an immediate upgrade and I suspect this is root of the problem, and nothing to do with db privileges or even php versions! I'm playing with setting up a clean install on a D8 droplet at digital ocean. If that hits the same issues we're in trouble. But if I get a clean install there then I'll use that to try and figure out what's different about our container environment! Very many thanks for your help - you've got me on the right track I hope...
Title: Re: PHP version reporting incorrectly...
Post by: tino on July 06, 2018, 05:27:33 pm
Ok, I was curious and tries a fresh install, I can confirm I get the same error as you do.

I'll get back to you with the fix!
Title: Re: PHP version reporting incorrectly...
Post by: tino on July 06, 2018, 05:36:37 pm
It's the ALTER command itself which is failing.
Title: Re: PHP version reporting incorrectly...
Post by: tino on July 06, 2018, 05:52:46 pm
Can you replace your upgrade.php with the attached please?
Title: Re: PHP version reporting incorrectly...
Post by: emanuele on July 06, 2018, 06:26:58 pm
You go to the upgrade because you did not delete the install directory when the installer told you so.
So, just get rid of the directory and live happy! :D
Title: Re: PHP version reporting incorrectly...
Post by: emanuele on July 06, 2018, 06:28:07 pm
Quote from: thesohogeek – I was using Github master, but I'm now downloading this version 1.1.4 and will let you know what happens...
Then you were probably downloading development that has minimum version 7.something, do note the "default branch" at github is development and not master.
Title: Re: PHP version reporting incorrectly...
Post by: tino on July 06, 2018, 06:33:38 pm
Quote from: emanuele – You go to the upgrade because you did not delete the install directory when the installer told you so.
So, just get rid of the directory and live happy! :D

I removed that first time and it complained upgrade.php wasn’t there due to your policy dB changes

The bug I raised on GitHub is still valid I believe.
Title: Re: PHP version reporting incorrectly...
Post by: emanuele on July 07, 2018, 05:20:21 am
The bug open at github if I understand it correctly is about upgrade.php, but if you delete the install directory you delete every thing including upgrade.php.
Unless I misunderstood the report.
Title: Re: PHP version reporting incorrectly...
Post by: tino on July 07, 2018, 06:23:35 am
Quote from: emanuele – The bug open at github if I understand it correctly is about upgrade.php, but if you delete the install directory you delete every thing including upgrade.php.
Unless I misunderstood the report.

If I do that I get what is in the attached image, everytime I try to access the forum.

I change the url to http://192.168.0.65/elkarte2/index.php and it redirects to http://192.168.0.65/elkarte2/install/upgrade.php

Ok so it removes the contents of the install directory but not the directory itself, this is what causes the issue.

Although I think the db query call should be changed also. So I would say there are two bugs.
Title: Re: PHP version reporting incorrectly...
Post by: emanuele on July 07, 2018, 07:17:09 am
The test is on the directory, so it is not a bug per se, but the intended behaviour. We can discuss is there is a more appropriate.
The query is indeed a bug.
Title: Re: PHP version reporting incorrectly...
Post by: tino on July 07, 2018, 07:44:18 am
Quote from: emanuele – The test is on the directory, so it is not a bug per se, but the intended behaviour.

The issue with this is that on my install ticking the button to remove the install files ( in the final step ) does not remove the install directory, this means it tries to load upgrade.php, which is no longer there as I removed it.

If I manually remove the install directory all is well. I don't think this is user friendly.