Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
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
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
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
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
Re: Warning: Constant IMAGETYPE_SVG already defined?
Offline
Re: Warning: Constant IMAGETYPE_SVG already defined?
etc wrote #341596:
We do it already
No I mean, we use 99 and they use 21 so we need to match it.
And there is no metion of
IMAGETYPE_SVGon l.683 oftxplib_misc.php.
Yeah, but it’s in 4.9.0-beta.2. So it’ll clash with PHP 8.5’s internals.
Last edited by Bloke (Today 10:55:44)
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