Page 1 of 1

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

PostPosted: 05. September 2021 22:28
by hotnoob
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.

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

PostPosted: 10. November 2021 10:03
by hevada
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!

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

PostPosted: 10. November 2021 17:24
by Nobbie
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.

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

PostPosted: 17. November 2021 20:20
by Doors
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.

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

PostPosted: 14. February 2022 07:53
by centurionguy
I have done a clean install of Xampp v3.3.0 with PHP 8.1.2. The problem with PEAR still exists.

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

PostPosted: 19. August 2023 17:29
by burhanxMAN
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

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

PostPosted: 19. August 2023 22:59
by burhanxMAN
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

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

PostPosted: 20. August 2023 19:57
by burhanxMAN
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.

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

PostPosted: 23. April 2024 15:05
by chemFelix
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!!