Intereting Posts
PHP занимает 90 раз больше времени для запуска запроса, чем клиент MySQL создание фоновых процессов в php для продолжительного процесса Регулярные выражения PCRE с использованием подпрограмм named pattern Команда phpize не найдена при запуске в терминале добавить несколько данных в xml-файл с помощью PHP xmlwriter PHP запускает скрипт при истечении сеанса PHP и JS в многостраничной среде Как включить https (localhost) url на сервере WAMP (v2.5)? объединить проекты symfony1 и Symfony2 Выделение слов в Javascript – Почему они не будут выделены после полной загрузки страницы? Как получить URL-адрес настраиваемого элемента в Magento? Как мне пройти через массив PHP, содержащий данные, возвращаемые из MySQL? модель существует или нет в YII с использованием настраиваемой функции – Производительность Не удается отправить сеанс cookie – уже отправленные заголовки Запрос на ранжирование группы MYSQL PHP

Windows Installing PHPUnit через PEAR – Установка PHPUnit через PEAR

Когда я запускаю:

peardev install phpunit/PHPUnit 

Я получаю следующее:

 No releases available for package "pear.phpunit.de/PHPUnit" install failed 

Я запустил следующее:

 pear channel-discover pear.phpunit.de Channel "pear.phpunit.de" is already initialized 

а также

 pear install --alldeps phpunit/PHPUnit No releases available for package "pear.phpunit.de/PHPUnit" install failed 

а также

 pear remote-list -c phpunit CHANNEL PHPUNIT AVAILABLE PACKAGES: =================================== PACKAGE VERSION DbUnit 1.0.2 File_Iterator 1.2.6 Object_Freezer 1.0.0 PHPUnit 3.5.14 PHPUnit_MockObject 1.0.9 PHPUnit_Selenium 1.0.3 PHP_CodeBrowser 1.0.0 PHP_CodeCoverage 1.0.4 PHP_Timer 1.0.0 PHP_TokenStream 1.0.1 Text_Template 1.1.0 bytekit 1.1.1 phpUnderControl 0.5.0 phpcpd 1.3.2 phpdcd 0.9.2 phploc 1.6.1 ppw 1.0.4 test_helpers 1.1.0 

а также

 pear upgrade pear No releases available for package "pear.php.net/pear" upgrade failed 

Пожалуйста, помогите мне разрывать мои волосы здесь.

ОБНОВЛЕНО

 C:\Program Files\PHP>pear channel-discover pear.phpunit.de Channel "pear.phpunit.de" is already initialized C:\Program Files\PHP>pear channel-discover components.ez.no Channel "components.ez.no" is already initialized C:\Program Files\PHP>pear channel-discover pear.symfony-project.com Channel "pear.symfony-project.com" is already initialized C:\Program Files\PHP>pear install phpunit/PHPUnit No releases available for package "pear.phpunit.de/PHPUnit" install failed 

ОБНОВЛЕНИЕ 2

 C:\Program Files\PHP>pear update-channels Updating channel "components.ez.no" Channel "components.ez.no" is up to date Updating channel "doc.php.net" Channel "doc.php.net" is up to date Updating channel "pear.php.net" Channel "pear.php.net" is up to date Updating channel "pear.phpunit.de" Channel "pear.phpunit.de" is up to date Updating channel "pear.symfony-project.com" Channel "pear.symfony-project.com" is up to date Updating channel "pecl.php.net" Channel "pecl.php.net" is up to date 

Обновление 3

побежал

 C:\Program Files\PHP>pear clear-cache reading directory C:\Users\stephen\AppData\Local\Temp\pear\cache 136 cache entries cleared C:\Program Files\PHP>pear install -a -f phpunit/PHPUnit phpunit/PHPUnit can optionally use PHP extension "dbus" phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2 .0.5) downloading PHPUnit-3.5.14.tgz ... Starting to download PHPUnit-3.5.14.tgz (118,697 bytes) ..........................done: 118,697 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\PHPUnit-3. 5.14.tgz" Unable to create directory 'C:/Program/tmpF4D2.tmp' Unable to create path for C:/Program/tmpF4D2.tmp/package.xml Download of "phpunit/PHPUnit" succeeded, but it is not a valid package archive Error: cannot download "phpunit/PHPUnit" downloading DbUnit-1.0.2.tgz ... Starting to download DbUnit-1.0.2.tgz (39,231 bytes) ...done: 39,231 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\DbUnit-1.0 .2.tgz" Unable to create directory 'C:/Program/tmpF64A.tmp' Unable to create path for C:/Program/tmpF64A.tmp/package.xml Download of "phpunit/DbUnit" succeeded, but it is not a valid package archive Error: cannot download "phpunit/DbUnit" downloading File_Iterator-1.2.6.tgz ... Starting to download File_Iterator-1.2.6.tgz (3,439 bytes) ...done: 3,439 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\File_Itera tor-1.2.6.tgz" Unable to create directory 'C:/Program/tmpF6E7.tmp' Unable to create path for C:/Program/tmpF6E7.tmp/package.xml Download of "phpunit/File_Iterator" succeeded, but it is not a valid package arc hive Error: cannot download "phpunit/File_Iterator" downloading PHP_CodeCoverage-1.0.4.tgz ... Starting to download PHP_CodeCoverage-1.0.4.tgz (115,029 bytes) ...done: 115,029 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\PHP_CodeCo verage-1.0.4.tgz" Unable to create directory 'C:/Program/tmpF83F.tmp' Unable to create path for C:/Program/tmpF83F.tmp/package.xml Download of "phpunit/PHP_CodeCoverage" succeeded, but it is not a valid package archive Error: cannot download "phpunit/PHP_CodeCoverage" downloading PHPUnit_MockObject-1.0.9.tgz ... Starting to download PHPUnit_MockObject-1.0.9.tgz (18,414 bytes) ...done: 18,414 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\PHPUnit_Mo ckObject-1.0.9.tgz" Unable to create directory 'C:/Program/tmpF939.tmp' Unable to create path for C:/Program/tmpF939.tmp/package.xml Download of "phpunit/PHPUnit_MockObject" succeeded, but it is not a valid packag e archive Error: cannot download "phpunit/PHPUnit_MockObject" downloading PHPUnit_Selenium-1.0.3.tgz ... Starting to download PHPUnit_Selenium-1.0.3.tgz (16,587 bytes) ...done: 16,587 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\PHPUnit_Se lenium-1.0.3.tgz" Unable to create directory 'C:/Program/tmpF9F6.tmp' Unable to create path for C:/Program/tmpF9F6.tmp/package.xml Download of "phpunit/PHPUnit_Selenium" succeeded, but it is not a valid package archive Error: cannot download "phpunit/PHPUnit_Selenium" downloading YAML-1.0.5.tgz ... Starting to download YAML-1.0.5.tgz (9,966 bytes) ...done: 9,966 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\YAML-1.0.5 .tgz" Unable to create directory 'C:/Program/tmpFA83.tmp' Unable to create path for C:/Program/tmpFA83.tmp/package.xml Download of "symfony/YAML" succeeded, but it is not a valid package archive Error: cannot download "symfony/YAML" downloading PHP_TokenStream-1.0.1.tgz ... Starting to download PHP_TokenStream-1.0.1.tgz (7,250 bytes) ...done: 7,250 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\PHP_TokenS tream-1.0.1.tgz" Unable to create directory 'C:/Program/tmpFB10.tmp' Unable to create path for C:/Program/tmpFB10.tmp/package.xml Download of "phpunit/PHP_TokenStream" succeeded, but it is not a valid package a rchive Error: cannot download "phpunit/PHP_TokenStream" downloading ConsoleTools-1.6.1.tgz ... Starting to download ConsoleTools-1.6.1.tgz (869,994 bytes) ...done: 869,994 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\ConsoleToo ls-1.6.1.tgz" Unable to create directory 'C:/Program/tmp9D.tmp' Unable to create path for C:/Program/tmp9D.tmp/package.xml Download of "ezc/ConsoleTools" succeeded, but it is not a valid package archive Error: cannot download "ezc/ConsoleTools" downloading Base-1.8.tgz ... Starting to download Base-1.8.tgz (236,357 bytes) ...done: 236,357 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\Base-1.8.t gz" Unable to create directory 'C:/Program/tmp36C.tmp' Unable to create path for C:/Program/tmp36C.tmp/package.xml Download of "ezc/Base" succeeded, but it is not a valid package archive Error: cannot download "ezc/Base" Download failed install failed погрешность C:\Program Files\PHP>pear clear-cache reading directory C:\Users\stephen\AppData\Local\Temp\pear\cache 136 cache entries cleared C:\Program Files\PHP>pear install -a -f phpunit/PHPUnit phpunit/PHPUnit can optionally use PHP extension "dbus" phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2 .0.5) downloading PHPUnit-3.5.14.tgz ... Starting to download PHPUnit-3.5.14.tgz (118,697 bytes) ..........................done: 118,697 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\PHPUnit-3. 5.14.tgz" Unable to create directory 'C:/Program/tmpF4D2.tmp' Unable to create path for C:/Program/tmpF4D2.tmp/package.xml Download of "phpunit/PHPUnit" succeeded, but it is not a valid package archive Error: cannot download "phpunit/PHPUnit" downloading DbUnit-1.0.2.tgz ... Starting to download DbUnit-1.0.2.tgz (39,231 bytes) ...done: 39,231 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\DbUnit-1.0 .2.tgz" Unable to create directory 'C:/Program/tmpF64A.tmp' Unable to create path for C:/Program/tmpF64A.tmp/package.xml Download of "phpunit/DbUnit" succeeded, but it is not a valid package archive Error: cannot download "phpunit/DbUnit" downloading File_Iterator-1.2.6.tgz ... Starting to download File_Iterator-1.2.6.tgz (3,439 bytes) ...done: 3,439 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\File_Itera tor-1.2.6.tgz" Unable to create directory 'C:/Program/tmpF6E7.tmp' Unable to create path for C:/Program/tmpF6E7.tmp/package.xml Download of "phpunit/File_Iterator" succeeded, but it is not a valid package arc hive Error: cannot download "phpunit/File_Iterator" downloading PHP_CodeCoverage-1.0.4.tgz ... Starting to download PHP_CodeCoverage-1.0.4.tgz (115,029 bytes) ...done: 115,029 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\PHP_CodeCo verage-1.0.4.tgz" Unable to create directory 'C:/Program/tmpF83F.tmp' Unable to create path for C:/Program/tmpF83F.tmp/package.xml Download of "phpunit/PHP_CodeCoverage" succeeded, but it is not a valid package archive Error: cannot download "phpunit/PHP_CodeCoverage" downloading PHPUnit_MockObject-1.0.9.tgz ... Starting to download PHPUnit_MockObject-1.0.9.tgz (18,414 bytes) ...done: 18,414 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\PHPUnit_Mo ckObject-1.0.9.tgz" Unable to create directory 'C:/Program/tmpF939.tmp' Unable to create path for C:/Program/tmpF939.tmp/package.xml Download of "phpunit/PHPUnit_MockObject" succeeded, but it is not a valid packag e archive Error: cannot download "phpunit/PHPUnit_MockObject" downloading PHPUnit_Selenium-1.0.3.tgz ... Starting to download PHPUnit_Selenium-1.0.3.tgz (16,587 bytes) ...done: 16,587 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\PHPUnit_Se lenium-1.0.3.tgz" Unable to create directory 'C:/Program/tmpF9F6.tmp' Unable to create path for C:/Program/tmpF9F6.tmp/package.xml Download of "phpunit/PHPUnit_Selenium" succeeded, but it is not a valid package archive Error: cannot download "phpunit/PHPUnit_Selenium" downloading YAML-1.0.5.tgz ... Starting to download YAML-1.0.5.tgz (9,966 bytes) ...done: 9,966 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\YAML-1.0.5 .tgz" Unable to create directory 'C:/Program/tmpFA83.tmp' Unable to create path for C:/Program/tmpFA83.tmp/package.xml Download of "symfony/YAML" succeeded, but it is not a valid package archive Error: cannot download "symfony/YAML" downloading PHP_TokenStream-1.0.1.tgz ... Starting to download PHP_TokenStream-1.0.1.tgz (7,250 bytes) ...done: 7,250 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\PHP_TokenS tream-1.0.1.tgz" Unable to create directory 'C:/Program/tmpFB10.tmp' Unable to create path for C:/Program/tmpFB10.tmp/package.xml Download of "phpunit/PHP_TokenStream" succeeded, but it is not a valid package a rchive Error: cannot download "phpunit/PHP_TokenStream" downloading ConsoleTools-1.6.1.tgz ... Starting to download ConsoleTools-1.6.1.tgz (869,994 bytes) ...done: 869,994 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\ConsoleToo ls-1.6.1.tgz" Unable to create directory 'C:/Program/tmp9D.tmp' Unable to create path for C:/Program/tmp9D.tmp/package.xml Download of "ezc/ConsoleTools" succeeded, but it is not a valid package archive Error: cannot download "ezc/ConsoleTools" downloading Base-1.8.tgz ... Starting to download Base-1.8.tgz (236,357 bytes) ...done: 236,357 bytes could not extract the package.xml file from "C:\Program Files\PHP\tmp\Base-1.8.t gz" Unable to create directory 'C:/Program/tmp36C.tmp' Unable to create path for C:/Program/tmp36C.tmp/package.xml Download of "ezc/Base" succeeded, but it is not a valid package archive Error: cannot download "ezc/Base" Download failed install failed 

Обновление 4

Установленный PHP в c: \ PHP

Выполните вышеуказанные шаги, и я теперь получаю:

 C:\PHP>peardev install phpunit/PHPUnit phpunit/PHPUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0 phpunit/PHPUnit can optionally use PHP extension "dbus" phpunit/DbUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0 phpunit/File_Iterator requires PEAR Installer (version >= 1.9.2), installed vers ion is 1.9.0 phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.1), installed v ersion is 1.9.0 phpunit/PHP_CodeCoverage requires package "phpunit/File_Iterator" (version >= 1. 2.2) phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2 .0.5) phpunit/PHPUnit_MockObject requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0 phpunit/PHPUnit_Selenium requires PEAR Installer (version >= 1.9.2), installed v ersion is 1.9.0 phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.1), installed ve rsion is 1.9.0 No valid packages found install failed C:\PHP>pear upgrade pear pear/pear is already installed and is the same as the released version 1.9.3 upgrade failed погрешность C:\PHP>peardev install phpunit/PHPUnit phpunit/PHPUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0 phpunit/PHPUnit can optionally use PHP extension "dbus" phpunit/DbUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0 phpunit/File_Iterator requires PEAR Installer (version >= 1.9.2), installed vers ion is 1.9.0 phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.1), installed v ersion is 1.9.0 phpunit/PHP_CodeCoverage requires package "phpunit/File_Iterator" (version >= 1. 2.2) phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2 .0.5) phpunit/PHPUnit_MockObject requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0 phpunit/PHPUnit_Selenium requires PEAR Installer (version >= 1.9.2), installed v ersion is 1.9.0 phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.1), installed ve rsion is 1.9.0 No valid packages found install failed C:\PHP>pear upgrade pear pear/pear is already installed and is the same as the released version 1.9.3 upgrade failed 

Обновление 5

 C:\PHP>pear upgrade pear pear/pear is already installed and is the same as the released version 1.9.3 upgrade failed C:\PHP>pear -V PEAR Version: 1.9.0 PHP Version: 5.2.17 Zend Engine Version: 2.2.0 

Груша обновления груша думает, что я 1.9.3, но груша говорит, что это версия 1.9.0

Я действительно новичок, но надеюсь на помощь.

Мне просто удалось установить PHPUnit минуту назад.

Мой env. это Wamp2.1.

Я точно не знаю, как это работает, но это сработало для меня, поэтому попробуйте это.

pear clear-cache тогда,

 pear install -a -f phpunit/PHPUnit 

Где-то в сообщении об ошибке я увидел что-то о кеше, поэтому использовал clear-cache .

Наверное, это сделало некоторый трюк в процессе установки.

Удачи!

На странице руководства

 pear channel-discover pear.phpunit.de pear channel-discover components.ez.no pear channel-discover pear.symfony-project.com pear install phpunit/PHPUnit 

Убедитесь, что у вас есть два дополнительных канала, которые требуются.

Редактировать:

Попробуйте следовать этому совету : pear update-channels

 could not extract the package.xml file from "C:\Program Files\PHP\tmp\YAML-1.0.5 .tgz" Unable to create directory 'C:/Program/tmpFA83.tmp' Unable to create path for C:/Program/tmpFA83.tmp/package.xml 

Это ошибка в установщике груши. Он не может справиться с SPACE на вашем пути и пытается прочитать неправильные файлы. Установка вашего php в папку без пробела – это единственное «исправление», которое я знаю о: /


Обновление 5:

 pear install --force --alldeps pear/pear 

все обновления каналов, которые он запрашивает

 pear install --force --alldeps phpunit/PHPUnit 

если вас попросят обновить канал, сделайте это и повторите

если команда Pear не работает, попробуйте это:

Во-первых, я предполагаю, что xampp установлен на C: \ xampp

  1. Откройте командную строку и перейдите на C: \ xampp \ php
  2. Введите «pear update-channels» (обновляет определения каналов)
  3. Напечатайте «обновление груши» (обновляет все существующие пакеты и грушу)
  4. Введите «pear channel-find components.ez.no» (это необходимо для PHPUnit)
  5. Введите «pear channel-discover pear.symfony-project.com» (также необходимый PHPUnit)
  6. Введите «pear channel-discover pear.phpunit.de» (это IS phpunit)
  7. Введите «pear install –alldeps phpunit / PHPUnit» (устанавливает PHPUnit и все зависимости)

У вас несколько версий PEAR, и они выполняются неправильно. См. Pear в окнах, отображающих разные номера версий, для того, как их исправить.

убедитесь, что вы запускаете командную строку как администратор и следуете этому

 pear channel-discover pear.phpunit.de pear channel-discover components.ez.no pear channel-discover pear.symfony-project.com pear install phpunit/PHPUnit