解决Composer should be invoked via the CLI version o
在运行的PHP FastCGI 环境中安装Composer时,遇到这个问题: drupalon@ lixiphp .com [~/public_html/demo/gitlist]# php composer.phar install Content-type: text/html Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcg
在运行的PHP FastCGI 环境中安装Composer时,遇到这个问题:
drupalon@lixiphp.com [~/public_html/demo/gitlist]# php composer.phar install
Content-type: text/htmlWarning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI
Fatal error: Uncaught exception ‘ErrorException’ with message ‘Undefined index: argv’ in phar:///home5/drupalon/public_html/demo/gitlist/composer.phar/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php:57
Stack trace:
#0 phar:///home5/drupalon/public_html/demo/gitlist/composer.phar/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php(57): Composer\Util\ErrorHandler::handle(8, ‘Undefined index…’, ‘phar:///home5/d…’, 57, Array)
#1 phar:///home5/drupalon/public_html/demo/gitlist/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(111): Symfony\Component\Console\Input\ArgvInput->__construct()
#2 phar:///home5/drupalon/public_html/demo/gitlist/composer.phar/src/Composer/Console/Application.php(83): Symfony\Component\Console\Application->run(NULL, Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///home5/drupalon/public_html/demo/gitlist/composer.phar/bin/composer(43): Composer\Console\Application->run()
#4 /home5/drupalon/public_html/demo/gitlist/c in phar:///home5/drupalon/public_html/demo/gitlist/composer.phar/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php on line 57
错误提示PHP Composer 无法在CGI/FastCGI 中安装,需要切换到 CLI 模式下安装。
Composer 解决方法
Symfony Fatal error: Uncaught exception ‘ErrorException’ with message ‘Undefined index: argv’ in Symfony/Component/Console/Input/ArgvInput.php:57
设置php.ini为以下值:
register_argc_argv=On
或者直接通过PHP CGI 命令行安装 Composer:
# curl -sS https://getcomposer.org/installer | php-cli
注意:PHP CLI 模式下默认register_argc_argv=On。
安装结果:
#!/usr/bin/env php
All settings correct for using Composer
Downloading…Composer successfully installed to: /home5/drupalon/public_html/demo/gitlist/composer.phar
Use it: php composer.phar
查看Composer是否安装成功:
# php-cli composer.phar -V
Composer version 7b72ce1b51ea075911226bf604625fed82399559
(...)
Read the rest of 解决Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI (85 words)
© lixiphp for LixiPHP, 2013. | Permalink | No comment |
Add to del.icio.us
Post tags: CLI, Composer, FastCGI, gitlist, Symfony
Feed enhanced by Better Feed from Ozh

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Composer provides advanced features, including: 1. Aliases: define convenient names for packages for repeated reference; 2. Scripts: execute custom commands when installing/updating packages, used to create database tables or compile resources; 3. Conflict resolution: use priorities Rules, satisfaction constraints, and package aliases resolve the different requirements of multiple packages for the same dependency version to avoid installation conflicts.

Answer: PHP microservices are deployed with HelmCharts for agile development and containerized with DockerContainer for isolation and scalability. Detailed description: Use HelmCharts to automatically deploy PHP microservices to achieve agile development. Docker images allow for rapid iteration and version control of microservices. The DockerContainer standard isolates microservices, and Kubernetes manages the availability and scalability of the containers. Use Prometheus and Grafana to monitor microservice performance and health, and create alarms and automatic repair mechanisms.

PHP code version control: There are two version control systems (VCS) commonly used in PHP development: Git: distributed VCS, where developers store copies of the code base locally to facilitate collaboration and offline work. Subversion: Centralized VCS, a unique copy of the code base is stored on a central server, providing more control. VCS helps teams track changes, collaborate and roll back to earlier versions.

PHPCI/CD is a key practice in DevOps projects that automates the build, test, and deployment processes to improve development efficiency and software quality. A typical PHPCI/CD pipeline consists of the following stages: 1) Continuous Integration: Whenever the code changes, the code is automatically built and tested. 2) Continuous deployment: Speed up delivery by automatically deploying tested and integrated code to the production environment. By implementing the PHPCI/CD pipeline, you can increase development efficiency, improve software quality, shorten time to market, and improve reliability.

Using Redis cache can greatly optimize the performance of PHP array paging. This can be achieved through the following steps: Install the Redis client. Connect to the Redis server. Create cache data and store each page of data into a Redis hash with the key "page:{page_number}". Get data from cache and avoid expensive operations on large arrays.

There are three main technologies for visualizing data structures in PHP: Graphviz: an open source tool that can create graphical representations such as charts, directed acyclic graphs, and decision trees. D3.js: JavaScript library for creating interactive, data-driven visualizations, generating HTML and data from PHP, and then visualizing it on the client side using D3.js. ASCIIFlow: A library for creating textual representation of data flow diagrams, suitable for visualization of processes and algorithms.

Answer: Use PHPCI/CD to achieve rapid iteration, including setting up CI/CD pipelines, automated testing and deployment processes. Set up a CI/CD pipeline: Select a CI/CD tool, configure the code repository, and define the build pipeline. Automated testing: Write unit and integration tests and use testing frameworks to simplify testing. Practical case: Using TravisCI: install TravisCI, define the pipeline, enable the pipeline, and view the results. Implement continuous delivery: select deployment tools, define deployment pipelines, and automate deployment. Benefits: Improve development efficiency, reduce errors, and shorten delivery time.

Summary: By integrating the PHPUnit unit testing framework and CI/CD pipeline, you can improve PHP code quality and accelerate software delivery. PHPUnit allows the creation of test cases to verify component functionality, and CI/CD tools such as GitLabCI and GitHubActions can automatically run these tests. Example: Validate the authentication controller with test cases to ensure the login functionality works as expected.
