xampp 8.0.10 - PHP 8 / Pear / PECL broken / syntax errors

Problems with the Windows version of XAMPP, questions, comments, and anything related.

xampp 8.0.10 - PHP 8 / Pear / PECL broken / syntax errors

Postby hotnoob » 05. September 2021 22:28

Code: Select all
pecl


Code: Select all
Fatal error: Array and string offset access syntax with curly braces is no longer supported in C:\xampp\php\pear\PEAR\Config.php on line 2095


tried replacing a few / fixing syntax, but there are hundreds to change.
needs to be updated for php8 syntax.
hotnoob
 
Posts: 2
Joined: 05. September 2021 22:25
XAMPP version: 8.0.10
Operating System: win10

Re: xampp 8.0.10 - PHP 8 / Pear / PECL broken / syntax error

Postby hevada » 10. November 2021 10:03

Thumbs up for this.

I'm trying to install WordPress CodeSniffer rules, but I can't, I get the same pear errors mentioned in the previous message.

I tried to manually fix some of them, but it's impossible, they are hundreds.
"Fatal error: Array and string offset access syntax with curly braces is no longer supported in .."

I also tried to update pear on my computer separately from xampp. but then I get version conflicts when starting xampp.

If possible, please update the pear package inside Xampp.
Thank you!
hevada
 
Posts: 1
Joined: 10. November 2021 09:48
XAMPP version: 8.0.12
Operating System: Windows 10

Re: xampp 8.0.10 - PHP 8 / Pear / PECL broken / syntax error

Postby Nobbie » 10. November 2021 17:24

I have Xampp 8.0.6 installed on a Linux machine and it seems that PEAR has been adapted. I edited Config.php from PEAR and jumped to line 2095, which shows up like this:

Code: Select all
 } elseif ($prepend[0] != '\\') {


This looks quite good, is it uses normal braces "[" and "]" instead of curly braces "{" and "}" (which caused the error). Could you have a look what you can see in your Config.php from PEAR in your Xampp installation? Line 2095 due to the error message. I dont use Windows anymore.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: xampp 8.0.10 - PHP 8 / Pear / PECL broken / syntax error

Postby Doors » 17. November 2021 20:20

Helping a customer update from a xampp system using php7 to php8.
They want pecl working.
Using xampp with PHP 8.0.6

The following files have array and string offsets that need to be fixed, which I have and it took a while.
This involved the replacement of {} with [] or () as needed.
String offsets get [].
arg() and other parametered calls get ().

    xampp\php\pear\System.php
    xampp\php\pear\Console\Getargs.php
    xampp\php\pear\Console\Getopt.php
    xampp\php\pear\File\Find.php
    xampp\php\pear\File\Util.php
    xampp\php\pear\File\Passwd\Custom.php
    xampp\php\pear\OS\Guess.php
    xampp\php\pear\PEAR\Autoloader.php
    xampp\php\pear\PEAR\Builder.php
    xampp\php\pear\PEAR\Command.php
    xampp\php\pear\PEAR\Common.php
    xampp\php\pear\PEAR\Config.php
    xampp\php\pear\PEAR\DependencyDB.php
    xampp\php\pear\PEAR\Downloader.php
    xampp\php\pear\PEAR\Installer.php
    xampp\php\pear\PEAR\PackageFile.php
    xampp\php\pear\PEAR\Registry.php
    xampp\php\pear\PEAR\Validate.php
    xampp\php\pear\PEAR\Command\Channels.php
    xampp\php\pear\PEAR\Command\Common.php
    xampp\php\pear\PEAR\Command\Config.php
    xampp\php\pear\PEAR\Installer\Role.php
    xampp\php\pear\PEAR\PackageFile\v1.php
    xampp\php\pear\PEAR\PackageFile\Generator\v1.php
    xampp\php\pear\PEAR\PackageFile\v2\Validator.php
    xampp\php\pear\PHP\CodeSniffer.php
    xampp\php\pear\PHP\CodeSniffer\CLI.php
    xampp\php\pear\PHP\CodeSniffer\File.php
    xampp\php\pear\PHP\CodeSniffer\CommentParser\AbstractParser.php
    xampp\php\pear\PHP\CodeSniffer\CommentParser\CommentElement.php
    xampp\php\pear\PHP\CodeSniffer\Standards\MySource\Sniffs\Channels\DisallowSelfActionsSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\MySource\Sniffs\CSS\BrowserSpecificStylesSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\PEAR\Sniffs\Commenting\FileCommentSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\PEAR\Sniffs\Commenting\InlineCommentSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidClassNameSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidFunctionNameSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidVariableNameSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\Squiz\Sniffs\Commenting\FileCommentSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\Squiz\Sniffs\Commenting\InlineCommentSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\Squiz\Sniffs\CSS\ColourDefinitionSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\Squiz\Sniffs\CSS\OpacitySniff.php
    xampp\php\pear\PHP\CodeSniffer\Tokenizers\CSS.php
    xampp\php\pear\PHP\Compat\Function\strripos.php
    xampp\php\pear\PHP\CompatInfo\Cli.php
    xampp\php\pear\PHP\CompatInfo\Renderer\Text.php
    xampp\php\pear\PHP\CompatInfo\Renderer\Xml.php
    xampp\php\pear\Text\Wiki\Parse\Default\Smiley.php
    xampp\php\pear\Text\Wiki\Parse\Default\Wikilink.php
    xampp\php\pear\Text\Wiki\Render\Xhtml\Colortext.php
    xampp\php\pear\Text\Wiki\Render\Xhtml\Url.php
    xampp\php\pear\XML\Util.php

Got pecl to give command list.
When I tried pecl list I got more errors
Each is deprecated in php7, removed in php8.
The following files need to have each() logic converted to foreach() logic.

    xampp\php\pear\PEAR.php
    xampp\php\pear\adodb\adodb-datadict.inc.php
    xampp\php\pear\adodb\adodb-error.inc.php
    xampp\php\pear\adodb\adodb.inc.php
    xampp\php\pear\adodb\toexport.inc.php
    xampp\php\pear\adodb\drivers\adodb-ado.inc.php
    xampp\php\pear\adodb\drivers\adodb-ado5.inc.php
    xampp\php\pear\Console\Getopt.php
    xampp\php\pear\File\Find.php
    xampp\php\pear\PEAR\Autoloader.php
    xampp\php\pear\PEAR\Command\Common.php
    xampp\php\pear\PHP\UML\Input\PHP\ParserImpl.php
    xampp\php\pear\PHPUnit\Util\Getopt.php
    xampp\php\pear\Text\Diff\Engine\native.php

Perhaps the each() can simply be replaced with foreach(), don't know yet.

Just wanted to pass on what I have found so far.
Doors
 
Posts: 3
Joined: 17. November 2021 17:47
XAMPP version: 8.0.6
Operating System: Windows 7

Re: xampp 8.0.10 - PHP 8 / Pear / PECL broken / syntax error

Postby centurionguy » 14. February 2022 07:53

I have done a clean install of Xampp v3.3.0 with PHP 8.1.2. The problem with PEAR still exists.
centurionguy
 
Posts: 1
Joined: 14. February 2022 07:49
XAMPP version: 3.3.0
Operating System: windows 10

Re: xampp 8.0.10 - PHP 8 / Pear / PECL broken / syntax error

Postby burhanxMAN » 19. August 2023 17:29

I had the same problem, after I did the installation of xampp-windows-x64-8.2.4-0-VS16-installer.exe / xampp PHP Version 8.2.4 .
I'm having trouble installing PEAR Mail
I've replaced all the {} signs with [] replaced all but I seem to fail each to become foreach with the correct code
I hope this issue is resolved because I'm still stuck on PHP 5
burhanxMAN
 
Posts: 3
Joined: 19. August 2023 13:01
XAMPP version: V3.3.0
Operating System: windows 11

Re: xampp 8.0.10 - PHP 8 / Pear / PECL broken / syntax error

Postby burhanxMAN » 19. August 2023 22:59

burhanxMAN wrote:I had the same problem, after I did the installation of xampp-windows-x64-8.2.4-0-VS16-installer.exe / xampp PHP Version 8.2.4 .
I'm having trouble installing PEAR Mail
I've replaced all the {} signs with [] replaced all but I seem to fail each to become foreach with the correct code
I hope this issue is resolved because I'm still stuck on PHP 5



Problem solved, i just ignore all pear errors, in my case i need pear mail, i just need to do manual copy of mail and net modules to pear folder, and its working in php 8.2.4
burhanxMAN
 
Posts: 3
Joined: 19. August 2023 13:01
XAMPP version: V3.3.0
Operating System: windows 11

Re: xampp 8.0.10 - PHP 8 / Pear / PECL broken / syntax error

Postby burhanxMAN » 20. August 2023 19:57

Doors wrote:Helping a customer update from a xampp system using php7 to php8.
They want pecl working.
Using xampp with PHP 8.0.6

The following files have array and string offsets that need to be fixed, which I have and it took a while.
This involved the replacement of {} with [] or () as needed.
String offsets get [].
arg() and other parametered calls get ().

    xampp\php\pear\System.php
    xampp\php\pear\Console\Getargs.php
    xampp\php\pear\Console\Getopt.php
    xampp\php\pear\File\Find.php
    xampp\php\pear\File\Util.php
    xampp\php\pear\File\Passwd\Custom.php
    xampp\php\pear\OS\Guess.php
    xampp\php\pear\PEAR\Autoloader.php
    xampp\php\pear\PEAR\Builder.php
    xampp\php\pear\PEAR\Command.php
    xampp\php\pear\PEAR\Common.php
    xampp\php\pear\PEAR\Config.php
    xampp\php\pear\PEAR\DependencyDB.php
    xampp\php\pear\PEAR\Downloader.php
    xampp\php\pear\PEAR\Installer.php
    xampp\php\pear\PEAR\PackageFile.php
    xampp\php\pear\PEAR\Registry.php
    xampp\php\pear\PEAR\Validate.php
    xampp\php\pear\PEAR\Command\Channels.php
    xampp\php\pear\PEAR\Command\Common.php
    xampp\php\pear\PEAR\Command\Config.php
    xampp\php\pear\PEAR\Installer\Role.php
    xampp\php\pear\PEAR\PackageFile\v1.php
    xampp\php\pear\PEAR\PackageFile\Generator\v1.php
    xampp\php\pear\PEAR\PackageFile\v2\Validator.php
    xampp\php\pear\PHP\CodeSniffer.php
    xampp\php\pear\PHP\CodeSniffer\CLI.php
    xampp\php\pear\PHP\CodeSniffer\File.php
    xampp\php\pear\PHP\CodeSniffer\CommentParser\AbstractParser.php
    xampp\php\pear\PHP\CodeSniffer\CommentParser\CommentElement.php
    xampp\php\pear\PHP\CodeSniffer\Standards\MySource\Sniffs\Channels\DisallowSelfActionsSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\MySource\Sniffs\CSS\BrowserSpecificStylesSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\PEAR\Sniffs\Commenting\FileCommentSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\PEAR\Sniffs\Commenting\InlineCommentSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidClassNameSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidFunctionNameSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidVariableNameSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\Squiz\Sniffs\Commenting\FileCommentSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\Squiz\Sniffs\Commenting\InlineCommentSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\Squiz\Sniffs\CSS\ColourDefinitionSniff.php
    xampp\php\pear\PHP\CodeSniffer\Standards\Squiz\Sniffs\CSS\OpacitySniff.php
    xampp\php\pear\PHP\CodeSniffer\Tokenizers\CSS.php
    xampp\php\pear\PHP\Compat\Function\strripos.php
    xampp\php\pear\PHP\CompatInfo\Cli.php
    xampp\php\pear\PHP\CompatInfo\Renderer\Text.php
    xampp\php\pear\PHP\CompatInfo\Renderer\Xml.php
    xampp\php\pear\Text\Wiki\Parse\Default\Smiley.php
    xampp\php\pear\Text\Wiki\Parse\Default\Wikilink.php
    xampp\php\pear\Text\Wiki\Render\Xhtml\Colortext.php
    xampp\php\pear\Text\Wiki\Render\Xhtml\Url.php
    xampp\php\pear\XML\Util.php

Got pecl to give command list.
When I tried pecl list I got more errors
Each is deprecated in php7, removed in php8.
The following files need to have each() logic converted to foreach() logic.

    xampp\php\pear\PEAR.php
    xampp\php\pear\adodb\adodb-datadict.inc.php
    xampp\php\pear\adodb\adodb-error.inc.php
    xampp\php\pear\adodb\adodb.inc.php
    xampp\php\pear\adodb\toexport.inc.php
    xampp\php\pear\adodb\drivers\adodb-ado.inc.php
    xampp\php\pear\adodb\drivers\adodb-ado5.inc.php
    xampp\php\pear\Console\Getopt.php
    xampp\php\pear\File\Find.php
    xampp\php\pear\PEAR\Autoloader.php
    xampp\php\pear\PEAR\Command\Common.php
    xampp\php\pear\PHP\UML\Input\PHP\ParserImpl.php
    xampp\php\pear\PHPUnit\Util\Getopt.php
    xampp\php\pear\Text\Diff\Engine\native.php

Perhaps the each() can simply be replaced with foreach(), don't know yet.

Just wanted to pass on what I have found so far.


fix the pear script by replacing the symbol { } with [ ] and replacing the each() function with forech() in my case it can only run informational commands without errors, such as displaying version info, lists etc., but still an error if the command is installed, but at least your information is very helpful.
burhanxMAN
 
Posts: 3
Joined: 19. August 2023 13:01
XAMPP version: V3.3.0
Operating System: windows 11

Re: xampp 8.0.10 - PHP 8 / Pear / PECL broken / syntax error

Postby chemFelix » 23. April 2024 15:05

It seems that even in the most recent versions of Xampp, the (quite outdated) version 1.10.1 of PEAR is bundled, while Ubuntu 22.04 already ships with 1.10.12 (where the curly brackets were cleaned). Current version AFAIK is 1.10.15.

@Apachefriends: Could you replace this? It would presumably be a quick operation, and with PHP8.x the old version 1.10.1 of PEAR is not usable anyway. If developers relying on Xampp as beginner-friendly WAMP stack for their open source projects would have to explain to their users how to replace PEAR on each installation, it would be far more complicated... Thanks very much!!
chemFelix
 
Posts: 3
Joined: 31. August 2010 08:57


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 168 guests