Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Yesterday 17:54:56

agovella
Member
From: Houston, TX
Registered: 2005-05-01
Posts: 87
Website Twitter

Warning: Constant IMAGETYPE_SVG already defined?

Migrating a site to Opalstack and the new site is getting this error:
Warning: Constant IMAGETYPE_SVG already defined, this will be an error in PHP 9 in /home/agovella/apps/pxd/textpattern/lib/txplib_misc.php on line 683

You can see it live at this URL:
https://agovella.opalstacked.com/users/user-target

I also get the error on the admin side.

Offline

#2 Yesterday 17:59:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,159
Website GitHub

Re: Warning: Constant IMAGETYPE_SVG already defined?

Balls, I’ll fix that, sorry.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 Yesterday 18:12:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,159
Website GitHub

Re: Warning: Constant IMAGETYPE_SVG already defined?

Actually, you shouldn’t be getting this warning. As far as I can see, the only way this would occur is if you were running 4.9.0-beta.2, upgraded to the latest dev, but didn’t update all files. Then it would trigger that issue because I moved the constant definition from txplib_misc.php to its proper location in constants.php.

Please double check that all your files are up-to-date and report back. Thanks.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 Yesterday 19:33:03

agovella
Member
From: Houston, TX
Registered: 2005-05-01
Posts: 87
Website Twitter

Re: Warning: Constant IMAGETYPE_SVG already defined?

I re-upgraded all the files to the latest beta and still got the error.

I went and re-reviewed everything in my app setup and config, etc. and found that I had selected PHP 8.5.

My other site that was working fine is using PHP 8.4.

I changed it from PHP 8.5 to PHP 8.4 and the error went away.

Offline

#5 Yesterday 21:40:29

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,201
Website Mastodon

Re: Warning: Constant IMAGETYPE_SVG already defined?

agovella wrote #341587:

I re-upgraded all the files to the latest beta and still got the error.

I went and re-reviewed everything in my app setup and config, etc. and found that I had selected PHP 8.5.

My other site that was working fine is using PHP 8.4.

I changed it from PHP 8.5 to PHP 8.4 and the error went away.

wonder if this explanation has any bearing on your errors:

The message "Constant IMAGETYPE_SVG already defined" is a PHP warning indicating that the constant is being defined more than once within your code. The IMAGETYPE_SVG constant itself is a standard, built-in PHP constant introduced in PHP 8.5, available when the ext-libxml extension is loaded.

…. texted postive

Offline

#6 Today 01:58:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,159
Website GitHub

Re: Warning: Constant IMAGETYPE_SVG already defined?

bici wrote #341590:

The message "Constant IMAGETYPE_SVG already defined" is a PHP warning indicating that the constant is being defined more than once within your code. The IMAGETYPE_SVG constant itself is a standard, built-in PHP constant introduced in PHP 8.5, available when the ext-libxml extension is loaded....

Drat. We’ll have to change our version to.match their constant value for versions < 8.5 and check it’s not already defined. That’s what’s tripping up the beta because it’s not PHP 8.5 compatible.

Thanks, will fix.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB