6 echo ">>> Performing pre-installation checks"
8 echo ">>> Checking for mysql server"
9 if [ "$(pidof mysqld)" ]
15 echo -e "${red}>>> FreePBX requires Mysql server!"
16 echo -e ">>> Mysql is not Running!"
17 echo -e ">>> Please start Mysql server before continuing the installation!"
21 echo ">>> Checking for Apache"
22 if [ "$(pidof httpd)" ]
28 echo -e "${red}>>> FreePBX requires Apache!"
29 echo -e ">>> Apache is not Running!"
30 echo -e ">>> Please start Apache before continuing the installation!"
34 php_config="/etc/php/php.ini"
35 echo ">>> Checking for PHP"
42 echo -e "${red}>>> FreePBX requires PHP!"
43 echo -e ">>> Please enable PHP and restart Apache"
44 echo -e ">>> before continuing the installation!"
48 echo ">>> Checking for PHP-MYSQL"
49 if [ "$(grep '^extension=mysql.so' /etc/php/php.ini)" ]
55 echo -e "${red}>>> FreePBX requires PHP-MYSQL!"
56 echo -e ">>> Please enable mysql.so in php.ini and restart Apache"
57 echo -e ">>> before continuing the installation!"
61 echo ">>> Checking for PHP-POSIX"
62 if [ "$(grep '^extension=mysql.so' /etc/php/php.ini)" ]
68 echo -e "${red}>>> FreePBX requires PHP-POSIX!"
69 echo -e ">>> Please enable posix.so in php.ini and restart Apache"
70 echo -e ">>> before continuing the installation!"
74 echo ">>> Checking if open_basedir is set"
75 if [ "$(grep '^open_basedir' /etc/php/php.ini)" ]
77 echo -e "${red}>>> FreePBX cannot be installed with open_basedir set."
78 echo -e ">>> Please comment out open_basedir in php.ini and restart Apache"
79 echo -e ">>> before continuing the installation!"
91 echo ">>> Please create databases for FreePBX using the following commands:"
92 echo ">>> # mysqladmin create asteriskcdrdb -p"
93 echo ">>> # mysql --user=root --password=db_root_pwd asteriskcdrdb < /usr/src/freepbx-$1/SQL/cdr_mysql_table.sql"
96 echo ">>> # mysqladmin create asterisk -p"
97 echo ">>> # mysql --user root -p asterisk < /usr/src/freepbx-$1/SQL/newinstall.sql"
100 echo ">>> # mysql --user root -p"
101 echo ">>> mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'password';"
102 echo ">>> mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'password';"
103 echo ">>> mysql> quit"
105 echo ">>> And then run:"
107 echo ">>> cd /usr/src/freepbx-$1 && ./install_amp --username=asteriskuser --password=password"
109 echo ">>> to complete the installation"
114 echo ">>> Please run:"
116 echo ">>> cd /usr/src/freepbx-$1 && ./install_amp"
118 echo ">>> to complete the upgrade"