PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, August 30, 2022

[FIXED] How do I get PEAR.php with Composer?

 August 30, 2022     archive-tar, composer-php, pear, phing, php     No comments   

Issue

I installed pear/archive_tar to work with Phing, which I installed with Composer. However, I received this error:

BUILD FAILED
exception 'BuildException' with message 'Error reading project file [wrapped: You must have installed the PEAR Archive_Tar class in order to use TarTask.]' in vendor/phing/phing/classes/phing/parser/ProjectConfigurator.php:197

I added the PEAR repository to Composer and updated, but it still did not work.

The second half of this question branched off here.


Solution

I set my composer.json to this, and it was fixed:

{
    "repositories": [
        {
            "type": "pear",
            "url": "http://pear.php.net"
        }
    ],
    "require": {
        "phing/phing" : "2.6.1",
        "pear-pear.php.net/pear": "*"
    }
}

Native Composer libraries such as this do not work, because Composer does not add the pear/archive_tar package to the autoloader:

{
    "require": {
        "phing/phing" : "2.6.1",
        "rsky/pear-core-min" : "dev-master",
        "pear/archive_tar" : "1.3.11"
    }
}


Answered By - NobleUplift
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing