composer global require laravel/installer
[Changed current directory to /root/.config/composer]
Problem 1
- laravel/installer v3.0.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- laravel/installer v3.0.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- Installation request for laravel/installer ^3.0 -> satisfiable by laravel/installer[v3.0.0, v3.0.1].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/opt/remi/php72/php.ini
- /etc/opt/remi/php72/php.d/10-opcache.ini
- /etc/opt/remi/php72/php.d/20-bcmath.ini
- /etc/opt/remi/php72/php.d/20-bz2.ini
- /etc/opt/remi/php72/php.d/20-calendar.ini
- /etc/opt/remi/php72/php.d/20-ctype.ini
- /etc/opt/remi/php72/php.d/20-curl.ini
- /etc/opt/remi/php72/php.d/20-dom.ini
- /etc/opt/remi/php72/php.d/20-exif.ini
- /etc/opt/remi/php72/php.d/20-fileinfo.ini
- /etc/opt/remi/php72/php.d/20-ftp.ini
- /etc/opt/remi/php72/php.d/20-gd.ini
- /etc/opt/remi/php72/php.d/20-gettext.ini
- /etc/opt/remi/php72/php.d/20-iconv.ini
- /etc/opt/remi/php72/php.d/20-json.ini
- /etc/opt/remi/php72/php.d/20-mbstring.ini
- /etc/opt/remi/php72/php.d/20-mysqlnd.ini
- /etc/opt/remi/php72/php.d/20-pdo.ini
- /etc/opt/remi/php72/php.d/20-phar.ini
- /etc/opt/remi/php72/php.d/20-simplexml.ini
- /etc/opt/remi/php72/php.d/20-sockets.ini
- /etc/opt/remi/php72/php.d/20-sqlite3.ini
- /etc/opt/remi/php72/php.d/20-tokenizer.ini
- /etc/opt/remi/php72/php.d/20-xml.ini
- /etc/opt/remi/php72/php.d/20-xmlwriter.ini
- /etc/opt/remi/php72/php.d/20-xsl.ini
- /etc/opt/remi/php72/php.d/30-mysqli.ini
- /etc/opt/remi/php72/php.d/30-pdo_mysql.ini
- /etc/opt/remi/php72/php.d/30-pdo_sqlite.ini
- /etc/opt/remi/php72/php.d/30-wddx.ini
- /etc/opt/remi/php72/php.d/30-xmlreader.ini
- /etc/opt/remi/php72/php.d/30-xmlrpc.ini
- /etc/opt/remi/php72/php.d/40-igbinary.ini
- /etc/opt/remi/php72/php.d/40-msgpack.ini
- /etc/opt/remi/php72/php.d/50-redis.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
yum search zip php
yum install -y php72-php-pecl-zip.x86_64
yum install -y unzip
安装扩展注意与Apache+PHP或者Nginx+PHP的运行模式不同,WorkerMan是基于PHP命令行 PHP CLI 运行的,使用的是不同的PHP可执行程序,使用的php.ini文件也可能不同。所以在网页中打印phpinfo()看到安装了某个扩展,不代表命令行的PHP CLI也安装了对应的扩展。 如何确定PHP CLI安装了哪些扩展运行 php -m 会列出命令行 PHP CLI 已经安装的扩展,结果类似如下: - ~# php -m
- [PHP Modules]
- libevent
- posix
- pcntl
复制代码 如何确定PHP CLI 的php.ini文件的位置当我们安装扩展时,可能需要手动配置php.ini文件,把扩展加进去,所以要确认PHP CLI的php.ini文件的位置。可以运行php --ini查找PHP CLI的ini文件位置,结果类似如下(各个系统显示结果会有差异):
- ~# php --ini
- Configuration File (php.ini) Path: /etc/php5/cli
- Loaded Configuration File: /etc/php5/cli/php.ini
- Scan for additional .ini files in: /etc/php5/cli/conf.d
- Additional .ini files parsed: /etc/php5/cli/conf.d/apc.ini,
- /etc/php5/cli/conf.d/libevent.ini,
- /etc/php5/cli/conf.d/memcached.ini,
- /etc/php5/cli/conf.d/mysql.ini,
- /etc/php5/cli/conf.d/pdo.ini,
- /etc/php5/cli/conf.d/pdo_mysql.ini
复制代码
给PHP CLI安装扩展(安装memcached扩展为例) 方法一、使用apt或者yum命令安装 如果PHP是通过 apt 或者 yum 命令安装的,则扩展也可以通过 apt 或者 yum 安装
centos等系统yum安装PHP扩展方法
1、利用yum search查找扩展包
~# yum search memcached php php-pecl-memcached - memcached module for php5 2、使用yum install安装扩展包 ~# yum install -y php-pecl-memcached Reading package lists... Done Reading state information... Done ... 说明: 使用apt或者yum安装PHP扩展会自动配置php.ini文件,安装完直接可用,十分方便。缺点是有些扩展在apt或者yum中没有对应的扩展安装包。 https://blog.csdn.net/abel004/article/details/53957431
|