X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Fci%2Fsetup%2Fsetup_php.sh;h=cc72a7f2d6fe02eaf89548f42a8a40deab096384;hb=34d380712153dd582dbd548d8c1044e7649d4a0e;hp=e4302b9022c3afc7fb4b74ecaa314f8f447d4e33;hpb=8a6d52dd1915d5f9b706d3a4ec93b944e78f8f53;p=plcapi.git diff --git a/tests/ci/setup/setup_php.sh b/tests/ci/setup/setup_php.sh old mode 100644 new mode 100755 index e4302b9..cc72a7f --- a/tests/ci/setup/setup_php.sh +++ b/tests/ci/setup/setup_php.sh @@ -1,18 +1,20 @@ #!/bin/sh +# Has to be run as admin + +# To be kept in sync with setup_php_travis.sh + +# @todo make it optional to disable xdebug ? + set -e configure_php_ini() { - # @todo make this idempotent so that it can be run multiple times in a row + # note: these settings are not required for cli config echo "cgi.fix_pathinfo = 1" >> "${1}" echo "always_populate_raw_post_data = -1" >> "${1}" - # @todo this only disables xdebug for CLI. To do the same for the FPM config as well, should we use instead `phpdismod` ? - XDEBUG_INI=$(php -i | grep xdebug.ini | grep -v '=>' | head -1) - if [ "$XDEBUG_INI" != "" ]; then - XDEBUG_INI="$(echo "$XDEBUG_INI" | tr -d ',')" - mv "$XDEBUG_INI" "$XDEBUG_INI.bak"; - fi + # we disable xdebug for speed for both cli and web mode + phpdismod xdebug } # install php @@ -55,9 +57,18 @@ PHPVER=$(php -r 'echo implode(".",array_slice(explode(".",PHP_VERSION),0,2));' 2 configure_php_ini /etc/php/${PHPVER}/fpm/php.ini -# use a nice name for the php-fpm service, so that it does not depend on php version running +# use a nice name for the php-fpm service, so that it does not depend on php version running. Try to make that work +# both for docker and VMs service "php${PHPVER}-fpm" stop -ln -s "/etc/init.d/php${PHPVER}-fpm" /etc/init.d/php-fpm +if [ -f "/etc/init.d/php${PHPVER}-fpm" ]; then + ln -s "/etc/init.d/php${PHPVER}-fpm" /etc/init.d/php-fpm +fi +if [ -f "/lib/systemd/system/php${PHPVER}-fpm.service" ]; then + ln -s "/lib/systemd/system/php${PHPVER}-fpm.service" /lib/systemd/system/php-fpm.service + if [ ! -f /.dockerenv ]; then + systemctl daemon-reload + fi +fi # @todo shall we configure php-fpm?