wip github actions CI
[plcapi.git] / tests / ci / setup / setup_php_github.sh
1 #!/bin/sh
2
3 # Has to be run as admin
4
5 # To be kept in sync with setup_php_travis.sh
6
7 # @todo make it optional to disable xdebug ?
8
9 set -e
10
11 configure_php_ini() {
12     # note: these settings are not required for cli config
13     echo "cgi.fix_pathinfo = 1" >> "${1}"
14     echo "always_populate_raw_post_data = -1" >> "${1}"
15
16     # we disable xdebug for speed for both cli and web mode
17     phpdismod xdebug
18 }
19
20 PHPVER=$(php -r 'echo implode(".",array_slice(explode(".",PHP_VERSION),0,2));' 2>/dev/null)
21
22 # this is done via shivammathur/setup-php
23 #configure_php_ini /etc/php/${PHPVER}/fpm/php.ini
24
25 # install php-fpm
26 apt-get install php$PHPVER-fpm
27 cp /usr/sbin/php-fpm$PHPVER /usr/bin/php-fpm # copy to /usr/bin
28
29 # use a nice name for the php-fpm service, so that it does not depend on php version running
30 #service "php${PHPVER}-fpm" stop
31 #ln -s "/etc/init.d/php${PHPVER}-fpm" /etc/init.d/php-fpm
32
33 # @todo shall we configure php-fpm?
34
35 service php$PHPVER-fpm start
36 service php$PHPVER-fpm status
37
38 # configure apache
39 a2enconf php${PHPVER}-fpm
40 service apache2 restart