more cloud features (#1058)
[openemr.git] / cloud / assets / eb / 06-php-configuration.config
blobfb733f190e8b24bbfa3d075b46a7402b81157ccf
1 option_settings:
2   aws:elasticbeanstalk:application:environment:
3     MOUNT_DIRECTORY: '/var/app/current/openemr/sites/default'
5 commands:
6   create_post_dir:
7     command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/post"
8     ignoreErrors: true
10 files:
11   "/opt/elasticbeanstalk/hooks/appdeploy/post/06-php-configuration.sh":
12       mode: "000755"
13       content : |
14         #!/bin/bash
16         if [ -f /root/openemr_installed.lock ];
17           then exit 0
18         fi
20         MOUNT_DIRECTORY=$(/opt/elasticbeanstalk/bin/get-config environment | jq -r '.MOUNT_DIRECTORY')
21         if [ -f ${MOUNT_DIRECTORY}/timezone.txt ]
22           then
23             echo Found cached timezone!
24             TIMEZONE=$(< ${MOUNT_DIRECTORY}/timezone.txt)
25           else
26             TIMEZONE=$(/opt/elasticbeanstalk/bin/get-config environment | jq -r '.TIMEZONE')
27             echo $TIMEZONE > ${MOUNT_DIRECTORY}/timezone.txt
28             echo Cached timezone!
29         fi
31         echo "TIMEZONE: ${TIMEZONE} ..."
33         printf '\n\n05 PHP Configuration\n\n'
34         sed -i 's/max_execution_time\ =\ 30/max_execution_time\ =\ 60/' /etc/php.ini
35         sed -i 's/max_input_time\ =\ 60/max_input_time\ =\ -1/' /etc/php.ini
36         sed -i 's/;\ max_input_vars\ =\ 1000/max_input_vars\ =\ 3000/' /etc/php.ini
37         sed -i 's/memory_limit\ =\ 128M/memory_limit\ =\ 512M/' /etc/php.ini
38         sed -i 's/post_max_size\ =\ 8M/post_max_size\ =\ 30M/' /etc/php.ini
39         sed -i 's^date.timezone\ =\ UTC^date.timezone\ =\ '$TIMEZONE'^' /etc/php.ini
40         sed -i 's/auto_globals_jit\ =\ On/auto_globals_jit\ =\ On\nregister_globals\ =\ On/' /etc/php.ini
41         sed -i 's/short_open_tag\ =\ 1/short_open_tag\ =\ 0/' /etc/php.ini