Update php.sh

This commit is contained in:
FusionPBX 2017-04-23 01:42:03 -06:00 committed by GitHub
parent c4729342e6
commit 972c95984a
1 changed files with 16 additions and 6 deletions

View File

@ -3,13 +3,17 @@
#move to script directory so all relative paths work
cd "$(dirname "$0")"
#includes
. ./config.sh
. ./colors.sh
. ./arguments.sh
#send a message
verbose "Configuring php/nginx/php-fpm and permissions"
#get the timezone
TIMEZ=$(timedatectl | grep 'Time zone' | awk '{ print $3 }')
#update the php configuration
sed -i 's/user nginx/user freeswitch daemon/g' /etc/nginx/nginx.conf
chown -Rf freeswitch:daemon /var/lib/nginx
sed -ie "s#;date.timezone =#date.timezone = $TIMEZ#g" /etc/php.ini
@ -19,14 +23,19 @@ sed -ie 's/;listen.owner = nobody/listen.owner = nobody/g' /etc/php-fpm.d/www.co
sed -ie 's/;listen.group = nobody/listen.group = nobody/g' /etc/php-fpm.d/www.conf
sed -ie 's/user = apache/user = freeswitch/g' /etc/php-fpm.d/www.conf
sed -ie 's/group = apache/group = daemon/g' /etc/php-fpm.d/www.conf
mkdir -p /var/lib/php/session
chown -R freeswitch:daemon /var/lib/php/session
chmod -Rf 700 /var/lib/php/session
#update config if source is being used
#update the php.ini
#sed -ie 's/post_max_size = .*/post_max_size = 80M/g' /etc/php.ini
#sed -ie 's/upload_max_filesize = .*/upload_max_filesize = 80M/g' /etc/php.ini
#make the session directory
mkdir -p /var/lib/php/session
#update permissions
chown -R freeswitch:daemon /var/lib/php/session
chmod -Rf 700 /var/lib/php/session
#update the permissions
chown -R freeswitch.daemon /etc/freeswitch /var/lib/freeswitch /var/log/freeswitch /usr/share/freeswitch /var/www/fusionpbx
find /etc/freeswitch -type d -exec chmod 770 {} \;
find /var/lib/freeswitch -type d -exec chmod 770 {} \;
@ -39,4 +48,5 @@ find /var/log/freeswitch -type f -exec chmod 664 {} \;
find /usr/share/freeswitch -type f -exec chmod 664 {} \;
find /var/www/fusionpbx -type f -exec chmod 664 {} \;
verbose "php/nginx/php-fpm and permissions configured"
#send a message
verbose "php/nginx/php-fpm and permissions configured"