doudu7626 2017-12-05 10:02
浏览 131
已采纳

使用GitlabCI部署Laravel在mcrypt扩展上失败

I would like to deploy my Laravel project with GitLabCI and docker. I have a yaml file with the following before_script:

docker-php-ext-install mbstring mcrypt pdo_mysql curl json intl gd xml zip bz2 opcache

Its return with this:

error: /usr/src/php/ext/mcrypt does not exist

usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...]
   ie: /usr/local/bin/docker-php-ext-install gd mysqli
       /usr/local/bin/docker-php-ext-install pdo pdo_mysql
       /usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop

if custom ./configure arguments are necessary, see docker-php-ext-configure

Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip

Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.
ERROR: Job failed: exit code 1

I tried to install manually the mcrypt with apt-get install following these answers, but nothing worked for me. Cheked this forum post too, but there is no mentioned about this error.

gitlab-ci.yaml file:

before_script:
  # Update packages 
  - apt-get update -yqq

  - apt-get install -my wget gnupg
  # Upgrade to Node 7
  - curl -sL https://deb.nodesource.com/setup_7.x | bash -

  # Install dependencies
  - apt-get install bzip2 git nodejs libcurl4-gnutls-dev libicu-dev libmcrypt-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libpq-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev -yqq

  # Install php extensions
  - docker-php-ext-install mbstring pdo_mysql curl json intl gd xml zip bz2 opcache

  # Install Node dependencies.
  # comment this out if you don't have a node dependency
  - npm install
  - npm install -g bower
  - npm install -g gulp-cli

  # Install Composer and project dependencies.
  - curl -sS https://getcomposer.org/installer | php
  - php composer.phar install 

Using php7.0 and Laravel 5.3.2

  • 写回答

1条回答 默认 最新

  • dslkchyv673627 2018-03-19 14:59
    关注

    I ran into this issue. Mcrypt was deprecated in PHP 7.2. Here's how to get around it now:

      image: php:7.2
    
      before_script:
        # Update packages
        - apt-get update -yqq
    
        # Install dependencies
        - apt-get install git libcurl4-gnutls-dev libicu-dev libmcrypt-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libpq-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev -yqq
    
        # Install php extensions
        - docker-php-ext-install mbstring pdo_mysql curl json intl gd xml zip bz2 opcache pcntl
    
        ....    
    
        # PHP 7.2 Mcrypt & pcntl
        - pecl install mcrypt-1.0.1
        - docker-php-ext-enable mcrypt
    
        ....    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里