如何安装 parsecsv:寻求明确的步骤

如何安装 parsecsv:寻求明确的步骤

https://github.com/parsecsv/parsecsv-for-php#installation:

使用 Composer 安装很容易。只需在命令行中运行以下命令:

作曲家需要 parsecsv/php-parsecsv

如果您不使用 Drupal、Laravel、Symfony、Yii 等框架,您可能需要在 PHP 脚本中手动包含 Composer 的自动加载器文件:

需要一次目录。 '/vendor/autoload.php';

没有作曲家

不推荐,但技术上可行:您还可以克隆存储库或提取 ZIP。要使用 ParseCSV,您必须添加 require 'parsecsv.lib.php';线。

  1. 我对 Linux 很陌生,我不知道 Composer 是什么?安装的具体步骤是什么parsecsv
  2. 我需要下载哪些文件(如果有)?
  3. 我把文件放在哪里?
  4. 所描述的方法是否会自动将程序安装到标准 bin 路径(无论是什么)?

我使用的是 Centos 7。

[root@server test]# yum install composer: 产生一些错误:

Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-cli
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-openssl
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-iconv
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(composer/spdx-licenses) >= 1.2
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-reflection
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-json
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-justinrainbow-json-schema5
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-symfony-process
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-pcre
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-curl
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(seld/jsonlint) < 2
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-filter
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(fedora/autoloader)
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-hash
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-symfony-console
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(composer/semver) < 2
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(psr/log) < 2
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-phar
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-libxml
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-zip
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-PsrLog >= 1.0.0-8
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(composer/xdebug-handler) < 2
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(composer/ca-bundle) >= 1.0
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-date
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-spl
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-seld-phar-utils >= 1.0.1
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-dom
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-mbstring
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php(language) >= 5.3.2
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-xsl
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-zlib
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(seld/jsonlint) >= 1.4
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(composer/xdebug-handler) >= 1.1
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-simplexml
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(psr/log) >= 1.0
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(seld/phar-utils) >= 1.0
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(composer/spdx-licenses) < 2
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(seld/phar-utils) < 2
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(composer/ca-bundle) < 2
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-symfony-finder
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-symfony-filesystem
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-tokenizer
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-composer(composer/semver) >= 1.0
Error: Package: composer-1.9.1-1.el7.noarch (epel)
           Requires: php-intl
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

答案1

按照提到的方式运行composer require parsecsv/php-parsecsv。如果您没有 Composer,CentOS 会将其作为软件包提供:yum install composer

相关内容