Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-09-01 09:00:37

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,539
Website GitHub Twitter

Use of undefined constant JSON_UNESCAPED_UNICODE [SOLVED]

Hi all

I just upgraded a website form 4.6.2 tp 4.7.3 and now i cant connect to admin and there is error lik below:

Notice: Use of undefined constant JSON_UNESCAPED_UNICODE – assumed ‘JSON_UNESCAPED_UNICODE’ in /home/worldgates/public_html/textpattern/lib/constants.php on line 922
Notice: Use of undefined constant JSON_UNESCAPED_SLASHES – assumed ‘JSON_UNESCAPED_SLASHES’ in /home/worldgates/public_html/textpattern/lib/constants.php on line 922
This server runs PHP version 5.3.29. Textpattern needs PHP version 5.4.0 or better.

I am using php 7.2 (I tryed 7.1, 7.0 amd 5.6 but the error still the same)

I have also uploaded the textpattern folder twice to be sure it s not a upload problem.

Any idea where is the problem ?

Offline

#2 2019-09-01 09:14:46

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,742
Website

Re: Use of undefined constant JSON_UNESCAPED_UNICODE [SOLVED]

A long shot: Do you get the error message This server runs PHP version 5.3.29 when you switch to php 7.2, 7.1, 7.0 or 5.6?

If so, check whether you have a directive in your .htaccess that is perhaps overriding the setting in your control panel. You should be able to verify what is actually active by uploading a phpinfo file and running that file (delete again after use).


TXP Builders – finely-crafted code, design and txp

Offline

#3 2019-09-01 09:32:54

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,539
Website GitHub Twitter

Re: Use of undefined constant JSON_UNESCAPED_UNICODE [SOLVED]

Thanks jakob,

Yes i got the message about php version.

I am using the standard htaccess shipped with textpattern, the upgrade failed, i uploaded the txp 4.6.2 and got the website working again!

Strange.

Offline

#4 2019-09-01 09:37:32

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,742
Website

Re: Use of undefined constant JSON_UNESCAPED_UNICODE [SOLVED]

Dragondz wrote #319204:

Yes i got the message about php version.

Just checking we’re not talking at cross-purposes: do you mean, you got This server runs PHP version 5.3.29 when you have switched to PHP 7.2 in the control panel? (i.e. the version in the error message doesn’t match your setting in your control panel).
Then check for any .htaccess files in other folders higher up in your textpattern path that might be setting an AddHandler directive that is affecting your textpattern installation. Also check if your control panel might be injecting something like that somewhere.


TXP Builders – finely-crafted code, design and txp

Offline

#5 2019-09-01 11:29:02

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,539
Website GitHub Twitter

Re: Use of undefined constant JSON_UNESCAPED_UNICODE [SOLVED]

Hi

phpinfo() say that the php version is 5.3.29! hum i will check whats wrong with the hosting.

Cheers.

Offline

#6 2019-09-01 11:45:25

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,539
Website GitHub Twitter

Re: Use of undefined constant JSON_UNESCAPED_UNICODE [SOLVED]

Upgrade Succeeded,

Thanks Jacob.

Offline

#7 2019-09-01 13:03:37

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,742
Website

Re: Use of undefined constant JSON_UNESCAPED_UNICODE [SOLVED]

Excellent!


TXP Builders – finely-crafted code, design and txp

Offline

#8 2019-09-02 12:50:22

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,222
Website

Re: Use of undefined constant JSON_UNESCAPED_UNICODE [SOLVED]

Dragondz wrote #319207:

Upgrade Succeeded,

Out of curiosity – what was the actual issue ? PHP not updating when you asked for it through the control panel of your host?


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#9 2019-09-02 17:44:41

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,539
Website GitHub Twitter

Re: Use of undefined constant JSON_UNESCAPED_UNICODE [SOLVED]

Hi,
I changed the php version thrue cpanel to php7.2 but it hadent make it, then on cpanel i used multiphp to use php7.2 on my hosting and it succeeded.
To be sure wich php version you have check txp diagnostic or use phpinfo() function.

Offline

#10 2019-09-02 22:40:42

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,222
Website

Re: Use of undefined constant JSON_UNESCAPED_UNICODE [SOLVED]

@ Dragondz

Thank you. So basically PHP was stuck to an old version despite attempts to change it through the CP.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#11 2019-09-03 07:14:20

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,539
Website GitHub Twitter

Re: Use of undefined constant JSON_UNESCAPED_UNICODE [SOLVED]

@phiw13

Yes.

Offline

Board footer

Powered by FluxBB