2

私はこれについて何週間も頭を悩ませてきました。私は同様の問題を抱えている多くの人々を見つけ、私の問題の解決に向けて少し前進しましたが、完全ではありません.

WAMP サーバー 2.5 (PHP 5.5.12)

最初に Pear をインストールしましたが、何かがおかしくなったので (config 内のパスがおかしくなったのでしょうか?)、再度インストールを試みたところ、本当におかしくなりました。その中のファイルは空であるにも関わらず使用されていました)、そして Pyrus に一撃を与えました。現在、少なくともパッケージ管理としてはうまく機能しているようです。

私のスクリプトは少なくとも Mail.php スクリプトを見つけることができるようになったので、include_path(s) が正しく設定されていると思います。

include_path = ".;C:\wamp\bin\php\php5.5.12\pear\php"

私の電話、働いています:

include_once("Mail.php");

しかし、Mail.php は Pear.php が見つからないと文句を言っています:

C:\wamp\bin\php\php5.5.12\pear\php\ で必要な 'PEAR.php' (include_path='.;C:\wamp\bin\php\php5.5.12\pear\php') を開くことができませんでした46 行目の Mail.php

\php5.5.12 の下には Pear.php ファイルはありません。

これは、私が Pyrus を使用していて、Mail が Pear 環境で動作するように設定されているためですか? (Pyrus は「C:\wamp\bin\php\php5.5.12\pear にある PEAR インストールを使用する」と主張していますが、以下を参照してください。) Pear と Pyrus の両方をインストールする必要がありますか? Pear をインストールするには、pyrus.phar を使用する必要がありますか? 前述のように、Pear をインストールするこれまでの試みは成功とは言えませんでした。Pear と Pyrus の両方のドキュメントは、サブディレクトリなどに関して標準的なインストールがどのように見えるべきかを示すグラフィックを持つことで改善される可能性があります。

c:\wamp\bin\php\php5.5.12\pear\php>tree /f
Folder PATH listing for volume OS
Volume serial number is A4D7-1271
C:.
│   Mail.php
│
├───Auth
│   │   SASL.php
│   │
│   └───SASL
│           Anonymous.php
│           Common.php
│           CramMD5.php
│           DigestMD5.php
│           External.php
│           Login.php
│           Plain.php
│           SCRAM.php
│
├───Mail
│       mail.php
│       mock.php
│       null.php
│       RFC822.php
│       sendmail.php
│       smtp.php
│       smtpmx.php
│
└───Net
        SMTP.php
        Socket.php

ここに私の Pyrus 設定があります:

c:\wamp\bin\php\php5.5.12>php pyrus.phar get
Pyrus version 2.0.0a4 SHA-1: 72271D92C3AA1FA96DF9606CD538868544609A52
Using PEAR installation found at C:\wamp\bin\php\php5.5.12\pear
System paths:
  php_dir => C:\wamp\bin\php\php5.5.12\pear\php
  ext_dir => c:\wamp\bin\php\php5.5.12\ext\
  cfg_dir => C:\wamp\bin\php\php5.5.12\pear\cfg
  doc_dir => C:\wamp\bin\php\php5.5.12\pear\docs
  bin_dir => C:\wamp\bin\php\php5.5.12
  data_dir => C:\wamp\bin\php\php5.5.12\pear\data
  www_dir => C:\wamp\bin\php\php5.5.12\pear\www
  test_dir => C:\wamp\bin\php\php5.5.12\pear\tests
  src_dir => C:\wamp\bin\php\php5.5.12\pear\src
  php_bin => C:\wamp\bin\php\php5.5.12\php.exe
  php_ini => C:\wamp\bin\php\php5.5.12\php.ini
  php_prefix =>
  php_suffix =>
Custom System paths:
User config (from C:\Users\mrz\pear\pearconfig.xml):
  default_channel => pear2.php.net
  auto_discover => 0
  http_proxy =>
  cache_dir => C:\wamp\bin\php\php5.5.12\pear\cache
  temp_dir => C:\wamp\bin\php\php5.5.12\pear\temp
  verbose => 1
  preferred_state => stable
  umask => 0022
  cache_ttl => 3600
  my_pear_path => C:\wamp\bin\php\php5.5.12\pear
  plugins_dir => C:\Users\mrz\pear
(variables specific to pear2.php.net):
  username =>
  password =>
  preferred_mirror => pear2.php.net
  download_dir => C:\wamp\bin\php\php5.5.12\pear\downloads
  openssl_cert =>
  handle =>
  paranoia => 2
Custom User config (from C:\Users\mrz\pear\pearconfig.xml):
(variables specific to pear2.php.net):

どんな助けでも大歓迎です。

更新:試してみました

php pyrus.phar install pear/PEAR

https://pear.php.net/package/PEAR/に示されているように。

私は得る:

c:\wamp\bin\php\php5.5.12>php pyrus.phar install pear/PEAR
Pyrus version 2.0.0a4 SHA-1: 72271D92C3AA1FA96DF9606CD538868544609A52
Using PEAR installation found at C:\wamp\bin\php\php5.5.12\pear
Downloading pear.php.net/PEAR
Mime-type: application/octet-stream
Downloading pear.php.net/Archive_Tar=================================================================>] 100% (284/284 kb)
Mime-type: application/octet-stream
Downloading pear.php.net/Structures_Graph============================================================>] 100% (19/19 kb)
Mime-type: application/octet-stream
Downloading pear.php.net/Console_Getopt==============================================================>] 100% (12/12 kb)
Mime-type: application/octet-stream
Downloading pear.php.net/XML_Util====================================================================>] 100% ( 5/ 5 kb)
Mime-type: application/octet-stream
[====================================================================================================>] 100% (16/16 kb)
Warning: rename(C:\wamp\bin\php\php5.5.12,C:\wamp\bin\php\.old-php5.5.12): The process cannot access the file because it is bein
g used by another process. (code: 32) in phar://C:/wamp/bin/php/php5.5.12/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/AtomicFileTransacti
on/Transaction/TwoStage.php on line 82

Call Stack:
    0.0350    1218224   1. {main}() C:\wamp\bin\php\php5.5.12\pyrus.phar:0
    0.0580    2198784   2. Pyrus\ScriptFrontend\Commands->run() C:\wamp\bin\php\php5.5.12\pyrus.phar:69
    0.0970    3600832   3. Pyrus\ScriptFrontend\Commands->install() phar://C:/wamp/bin/php/php5.5.12/pyrus.phar/Pyrus-2.0.0a4/ph
p/Pyrus/ScriptFrontend/Commands.php:309
    0.1110    4364600   4. Pyrus\Installer::commit() phar://C:/wamp/bin/php/php5.5.12/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ScriptF
rontend/Commands.php:559
    8.9739   11845424   5. Pyrus\AtomicFileTransaction::commit() phar://C:/wamp/bin/php/php5.5.12/pyrus.phar/Pyrus-2.0.0a4/php/P
yrus/Installer.php:344
    8.9739   11845496   6. Pyrus\AtomicFileTransaction\Manager->commit() phar://C:/wamp/bin/php/php5.5.12/pyrus.phar/Pyrus-2.0.0
a4/php/Pyrus/AtomicFileTransaction.php:90
    8.9919   11845456   7. Pyrus\AtomicFileTransaction\Transaction\TwoStage->commit() phar://C:/wamp/bin/php/php5.5.12/pyrus.pha
r/Pyrus-2.0.0a4/php/Pyrus/AtomicFileTransaction/Manager.php:165
    8.9919   11845488   8. rename() phar://C:/wamp/bin/php/php5.5.12/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/AtomicFileTransaction/Tr
ansaction/TwoStage.php:82

Pyrus\Installer\Exception: Installation failed
 Pyrus\AtomicFileTransaction\MultiException: ERROR: commit failed
  Pyrus\IOException: CRITICAL - unable to complete transaction, rename of actual to backup path failed
   Pyrus\AtomicFileTransaction\RuntimeException: Cannot rollback - not in a transaction

php5.5.12 ディレクトリ全体の名前を変更しようとするのはなぜですか? またはそれは?ところで?

更新: OK、手動で Pear をインストールしました。include_path を次のように変更しました

include_path = ".;C:\wamp\bin\php\php5.5.12\pear"

そして私の呼びかけ

include_once("php\Mail.php");

そして、「行方不明」の Pear.php エラーを回避しました。しかし今、メールは Net_SMTP などを見つけることができません。

ガク。拡張子ごとに個別の include_path エントリを指定する必要がありますか? または、\php を削除して、その内容を \pear に移動し、関連するコードと構成を変更する必要がありますか? または、すべての拡張ファイル (dir ツリーなし) をスクリプトと同じ www dir にダンプしますか?

4

1 に答える 1