Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Add a php.ini setting for gitlab-ci
Julian
Julian

Posted on

     

Add a php.ini setting for gitlab-ci

sometimes you need to change a php.ini setting on the fly in your gitlab-ci. this is quite easy.

simple run something like:

echo 'phar.readonly="0"' >> /etc/php/7.1/cli/conf.d/ci.ini

i used my debian stretch docker file, which uses thehttps://deb.sury.org/ repository for php. your directory structure may differ.

you can find out where php is loading its config files from by running:

php --ini

this prints a list similar to this:

$ php --iniConfiguration File (php.ini) Path: /etc/php/7.1/cliLoaded Configuration File:         /etc/php/7.1/cli/php.iniScan for additional .ini files in: /etc/php/7.1/cli/conf.dAdditional .ini files parsed:      /etc/php/7.1/cli/conf.d/10-mysqlnd.ini,/etc/php/7.1/cli/conf.d/10-opcache.ini,/etc/php/7.1/cli/conf.d/10-pdo.ini,/etc/php/7.1/cli/conf.d/15-xml.ini,/etc/php/7.1/cli/conf.d/20-apcu.ini,/etc/php/7.1/cli/conf.d/20-apcu_bc.ini,/etc/php/7.1/cli/conf.d/20-bcmath.ini,/etc/php/7.1/cli/conf.d/20-bz2.ini,/etc/php/7.1/cli/conf.d/20-calendar.ini,/etc/php/7.1/cli/conf.d/20-ctype.ini,...

in debian all files in theconf.d directory are included. so we only need to put it inside this directory. you can also append the config to the main filephp.ini.

relevant part from thegitlab-ci.yml:

image: c33s/php:7.1...build:  stage: build  script:    - composer install    - php --ini    - echo 'phar.readonly="0"' >> /etc/php/7.1/cli/conf.d/ci.ini    - wget https://github.com/box-project/box2/releases/download/2.7.5/box-2.7.5.phar    - php box-2.7.5.phar build    - php satis.phar --version...

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

see https://dev.to/c33s/comment/3eck
  • Location
    Vienna, Austria
  • Joined

More fromJulian

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp