fusionpbx-install.sh/freebsd/resources/php.sh

88 lines
3.8 KiB
Bash
Raw Normal View History

#!/bin/sh
#includes
. ./config.sh
. ./colors.sh
2017-06-24 19:38:25 +02:00
#enable php fpm
echo 'php_fpm_enable="YES"' >> /etc/rc.conf
#set the default version of postgres
echo "DEFAULT_VERSIONS+=pgsql=$database_version" >> /etc/make.conf
echo "DEFAULT_VERSIONS+=ssl=openssl" >> /etc/make.conf
#install dependencies
if [ ."$php_version" = ."5" ]; then
pkg install --yes php56 php56-phar php56-pgsql php56-pdo php56-pdo_pgsql php56-pdo_odbc php56-pdo_sqlite php56-json php56-gd
2020-07-25 17:29:40 +02:00
pkg install --yes php56-imap php56-ldap php56-openssl php56-sockets php56-simplexml php56-xml php56-session php56-filter
2017-06-24 19:38:25 +02:00
fi
2018-05-23 06:59:56 +02:00
if [ ."$php_version" = ."7.1" ]; then
2017-06-24 19:38:25 +02:00
#pkg install --yes php70 php70-phar php70-pgsql php70-pdo php70-pdo_pgsql php70-pdo_odbc php70-pdo_sqlite php70-json php70-gd
2019-09-27 22:53:43 +02:00
#pkg install --yes php70-imap php70-ldap php70-openssl php70-sockets php70-simplexml php70-xml php70-session
2017-06-24 19:38:25 +02:00
pkg install --yes php71 php71-phar php71-pdo php71-pdo_odbc php71-pdo_sqlite php71-json php71-gd php71-imap
2020-07-25 17:29:40 +02:00
pkg install --yes php71-ldap php71-openssl php71-sockets php71-simplexml php71-xml php71-session php71-filter
2017-06-24 19:38:25 +02:00
if [ ."$database_version" = ."9.3" ]; then
pkg install --yes postgresql93-client
pkg install --yes php71-pdo_pgsql php71-pgsql
fi
if [ ."$database_version" = ."9.6" ]; then
pkg install --yes postgresql96-client
2017-07-21 19:45:54 +02:00
if [ .$(freebsd-version | head -c 2) = ."10" ]; then
2019-02-22 18:45:22 +01:00
pkg add https://www.fusionpbx.com/downloads/freebsd/10/php71-pdo_pgsql-7.1.6_1.txz
pkg add https://www.fusionpbx.com/downloads/freebsd/10/php71-pgsql-7.1.6_1.txz
2017-06-30 08:49:52 +02:00
fi
2017-07-21 19:45:54 +02:00
if [ .$(freebsd-version | head -c 2) = ."11" ]; then
2019-02-22 18:45:22 +01:00
pkg add https://www.fusionpbx.com/downloads/freebsd/11/php71-pdo_pgsql-7.1.6_1.txz
pkg add https://www.fusionpbx.com/downloads/freebsd/11/php71-pgsql-7.1.6_1.txz
2017-06-30 08:49:52 +02:00
fi
2017-06-24 19:38:25 +02:00
##set the current working directory
#cwd=$(pwd)
#install the packages from the ports
#cd /usr/ports/databases/php71-pdo_pgsql/ && make install clean BATCH=yes
#cd /usr/ports/databases/php71-pgsql && make install clean BATCH=yes
##reset the current working directory
#cd $cwd
fi
fi
2018-05-23 06:59:56 +02:00
if [ ."$php_version" = ."7.2" ]; then
pkg install --yes php72 php72-phar php72-pdo php72-pdo_odbc php72-pdo_sqlite php72-json php72-gd php72-imap
2020-06-20 19:06:27 +02:00
pkg install --yes php72-ldap php72-openssl php72-sockets php72-simplexml php72-xml php72-session php72-iconv
2020-07-25 17:29:40 +02:00
pkg intsall --yes php72-zlib php72-filter
2018-05-23 06:59:56 +02:00
if [ ."$database_version" = ."9.5" ]; then
pkg install --yes postgresql95-client
pkg install --yes php72-pdo_pgsql php72-pgsql
fi
if [ ."$database_version" = ."10" ]; then
pkg install --yes postgresql10-client
if [ .$(freebsd-version | head -c 2) = ."11" ]; then
2019-02-22 18:51:59 +01:00
pkg add -f https://www.fusionpbx.com/downloads/freebsd/11/php72-pgsql10-7.2.5.txz
2019-02-22 18:54:31 +01:00
pkg add -f https://www.fusionpbx.com/downloads/freebsd/11/php72-pdo_pgsql10-7.2.5.txz
2019-02-22 18:45:22 +01:00
fi
if [ .$(freebsd-version | head -c 2) = ."12" ]; then
2019-02-22 18:51:59 +01:00
pkg add -f https://www.fusionpbx.com/downloads/freebsd/12/php72-pgsql-7.2.15.txz
2019-02-22 18:54:31 +01:00
pkg add -f https://www.fusionpbx.com/downloads/freebsd/12/php72-pdo_pgsql-7.2.15.txz
2018-05-23 06:59:56 +02:00
fi
fi
fi
2020-03-19 05:25:31 +01:00
if [ ."$php_version" = ."7.3" ]; then
pkg install --yes php73 php73-phar php73-pdo php73-pdo_odbc php73-pdo_sqlite php73-json php73-gd php73-imap
2020-06-20 19:06:27 +02:00
pkg install --yes php73-ldap php73-openssl php73-sockets php73-simplexml php73-xml php73-session php73-iconv
2020-07-25 17:29:40 +02:00
pkg intsall --yes php73-zlib php73-filter
2020-03-19 05:25:31 +01:00
if [ ."$database_version" = ."11" ]; then
pkg install --yes postgresql11-client
pkg install --yes php73-pdo_pgsql php73-pgsql
fi
fi
#send a message
verbose "Configuring PHP"
#update config if source is being used
2017-04-15 23:54:38 +02:00
cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
sed -i' ' -e s:'post_max_size = .*:post_max_size = 80M:g' /usr/local/etc/php.ini
sed -i' ' -e s:'upload_max_filesize = .*:upload_max_filesize = 80M:g' /usr/local/etc/php.ini
2019-08-01 20:59:58 +02:00
sed -i' ' -e s:'; max_input_vars = .*:max_input_vars = 8000:g' /usr/local/etc/php.ini
#restart php-fpm
2017-03-26 22:07:55 +02:00
service php-fpm restart