在带有XAMPP的Windows 10中安装go-pear.phar时出错



我在尝试安装go-pear.phar时总是收到错误

这是错误,点击后Enter问题1-13, 'all' or Enter to continue:

1-13, 'all' or Enter to continue:
**ERROR**
Please, enter the php.exe path.

我也在我的环境路径中安装了 PHP。我确实与php --version核实并收到了消息

C:xamppphp>php --version
PHP 7.2.31 (cli) (built: May 12 2020 10:26:32) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

所以我继续使用命令安装go-pear.phar。但是我一直被困在上面的错误中。

C:xamppphp>php go-pear.phar
Are you installing a system-wide PEAR or a local copy?
(system|local) [system] :
Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.
1. Installation base ($prefix)                   : C:xamppphp
2. Temporary directory for processing            : C:xamppphptmp
3. Temporary directory for downloads             : C:xamppphptmp
4. Binaries directory                            : C:xamppphp
5. PHP code directory ($php_dir)                 : C:xamppphppear
6. Documentation directory                       : C:xamppphpdocs
7. Data directory                                : C:xamppphpdata
8. User-modifiable configuration files directory : C:xamppphpcfg
9. Public Web Files directory                    : C:xamppphpwww
10. System manual pages directory                 : C:xamppphpman
11. Tests directory                               : C:xamppphptests
12. Name of configuration file                    : C:WINDOWSpear.ini
13. Path to CLI php.exe                           :
1-13, 'all' or Enter to continue:
**ERROR**
Please, enter the php.exe path.

我也遇到了这个问题,经过许多不同的尝试,我终于让它工作了。

打开命令提示符

CD \xampp\php

C:\xampp\php\php go-pear.phar

您是在安装系统范围的 PEAR 还是本地副本? (系统|本地([系统] :

以下是新 PEAR 安装的建议文件布局。 自 更改单个位置,在前面键入数字 目录。 键入"全部"以更改所有内容,或只需按 Enter 键即可 接受这些位置。

  1. 安装基础 ($prefix( : C:\xampp\php
  2. 用于处理的临时目录:C:\xampp\php\tmp
  3. 用于下载的临时目录:C:\xampp\php\tmp
  4. 二进制文件目录 : C:\xampp\php
  5. PHP 代码目录 ($php_dir( : C:\xampp\php\pear
  6. 文档目录 : C:\xampp\php\docs
  7. 数据目录:C:\xampp\php\data
  8. 用户可修改的配置文件目录:C:\xampp\php\cfg
  9. 公共 Web 文件目录 : C:\xampp\php\www
    1. 系统手册页目录 : C:\xampp\php\man
    2. 测试目录 : C:\xampp\php\tests
    3. 配置文件的名称:C:\WINDOWS\pear.ini
    4. CLI php 的路径.exe :

1-13,"全部"或回车继续:13

弹出一个窗口浏览文件或文件夹

窗口浏览文件或文件夹

选择文件夹 C:\xampp\php 而不是文件 php.exe然后选择"确定">

然后你得到

PHP.exe (sapi: CLI( 找到。

以下是新 PEAR 安装的建议文件布局。 自 更改单个位置,在前面键入数字 目录。 键入"全部"以更改所有内容,或只需按 Enter 键即可 接受这些位置。

  1. 安装基础 ($prefix( : C:\xampp\php
  2. 用于处理的临时目录:C:\xampp\php\tmp
  3. 用于下载的临时目录:C:\xampp\php\tmp
  4. 二进制文件目录 : C:\xampp\php
  5. PHP 代码目录 ($php_dir( : C:\xampp\php\pear
  6. 文档目录 : C:\xampp\php\docs
  7. 数据目录:C:\xampp\php\data
  8. 用户可修改的配置文件目录:C:\xampp\php\cfg
  9. 公共 Web 文件目录 : C:\xampp\php\www
    1. 系统手册页目录 : C:\xampp\php\man
    2. 测试目录 : C:\xampp\php\tests
    3. 配置文件的名称:C:\WINDOWS\pear.ini
    4. CLI php
    5. .exe 的路径: C:\xampp\php\

1-13,"全部"或回车继续:[输入]

按回车键,你会得到

正在开始安装... 写入 C:\WINDOWS\pear.ini... 已初始化的注册表... 正在准备安装...

我什至尝试过在文件夹中手动输入 C:\xampp\php\,因为它在选择它后列出,但它继续出现错误。但是在窗口中选择文件夹有效。

最新更新