2017-02-23 17:53:37 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
#move to script directory so all relative paths work
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
2017-04-23 09:42:03 +02:00
|
|
|
#includes
|
|
|
|
|
. ./config.sh
|
2017-02-23 17:53:37 +01:00
|
|
|
. ./colors.sh
|
|
|
|
|
|
2019-02-14 07:00:25 +01:00
|
|
|
#send a message
|
|
|
|
|
verbose "Install PHP and PHP-FPM"
|
|
|
|
|
|
|
|
|
|
#set the version of php
|
|
|
|
|
#yum-config-manager --enable remi-php70
|
|
|
|
|
#yum-config-manager --enable remi-php71
|
|
|
|
|
yum-config-manager --enable remi-php72
|
|
|
|
|
|
|
|
|
|
#install dependencies
|
|
|
|
|
yum -y install php-fpm php-gd php-pgsql php-odbc php-curl php-imap php-mcrypt php-opcache php-common php-pdo php-soap php-xml php-xmlrpc php-cli php-gd
|
|
|
|
|
|
2017-04-23 09:42:03 +02:00
|
|
|
#send a message
|
2017-02-23 17:53:37 +01:00
|
|
|
verbose "Configuring php/nginx/php-fpm and permissions"
|
|
|
|
|
|
2017-04-23 09:42:03 +02:00
|
|
|
#get the timezone
|
2017-02-23 17:53:37 +01:00
|
|
|
TIMEZ=$(timedatectl | grep 'Time zone' | awk '{ print $3 }')
|
|
|
|
|
|
2017-04-23 09:42:03 +02:00
|
|
|
#update the php configuration
|
2017-02-23 17:53:37 +01:00
|
|
|
sed -ie "s#;date.timezone =#date.timezone = $TIMEZ#g" /etc/php.ini
|
|
|
|
|
sed -ie 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php.ini
|
|
|
|
|
sed -ie "s|listen = 127.0.0.1:9000|listen = /var/run/php-fpm/php-fpm.sock|g" /etc/php-fpm.d/www.conf
|
2019-06-04 02:51:05 +02:00
|
|
|
sed -ie 's/;listen.owner = nobody/listen.owner = freeswitch/g' /etc/php-fpm.d/www.conf
|
|
|
|
|
sed -ie 's/;listen.group = nobody/listen.group = daemon/g' /etc/php-fpm.d/www.conf
|
2017-02-23 17:53:37 +01:00
|
|
|
sed -ie 's/group = apache/group = daemon/g' /etc/php-fpm.d/www.conf
|
|
|
|
|
|
2017-04-23 09:42:03 +02:00
|
|
|
#update the php.ini
|
2017-02-23 17:53:37 +01:00
|
|
|
#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
|
2019-08-01 21:05:58 +02:00
|
|
|
#sed -ie 's/; max_input_vars = .*/max_input_vars = 8000/g' /etc/php.ini
|
2017-02-23 17:53:37 +01:00
|
|
|
|
2017-04-23 09:42:03 +02:00
|
|
|
#make the session directory
|
|
|
|
|
mkdir -p /var/lib/php/session
|
|
|
|
|
|
|
|
|
|
#update permissions
|
2017-09-22 07:51:07 +02:00
|
|
|
chmod -Rf 770 /var/lib/php/session
|
2017-04-23 09:42:03 +02:00
|
|
|
|
|
|
|
|
#update the permissions
|
2017-02-23 17:53:37 +01:00
|
|
|
find /var/www/fusionpbx -type d -exec chmod 770 {} \;
|
|
|
|
|
find /var/www/fusionpbx -type f -exec chmod 664 {} \;
|
|
|
|
|
|
2017-04-23 09:42:03 +02:00
|
|
|
#send a message
|
|
|
|
|
verbose "php/nginx/php-fpm and permissions configured"
|