FreePBX | Register | Issues | Wiki | Portal | Support

Non-distro install: bootstrap.php not found


(Alexander Pohl) #1

Hi,

I am trying to install FreePBX 15 on my Odroid C2 arm64 bit device running Arch Linux as this little device is currently my preferred home server running 24/7. I think this device will be powerful enough to connect 1-2 desk phones and a Telekom All IP SIP Trunk for home use.

Environment:
Up do date Arch Linux aarch64
FreePBX 15.0 git branch
Apache/2.4.38 (Unix)
PHP 7.3.1 (cli)
Asterisk 16.1.1
NodeJS 11.8.0
MariaDB 10.3.12

I started by following the non-distro installation guide at the FreePBX Wiki (the link I am not allowed to put here???). After downloading all the sources from the git repository I executed the install script (without --dev-links) and always get the following error:

[alarm@odroid framework]$ sudo ./install 
Database engine [mysql]: 
Database name [asterisk]: 
Database server address [localhost]: 
CDR Database name [asteriskcdrdb]: 
Database username [root]: 
Database password: mariadb
File owner user [asterisk]: 
File owner group [asterisk]: 
Filesystem location from which FreePBX files will be served [/var/www/html]: /srv/http
Filesystem location from which Asterisk configuration files will be served [/etc/asterisk]: 
Filesystem location for Asterisk modules [/usr/lib/asterisk/modules]: 
Filesystem location for Asterisk lib files [/var/lib/asterisk]: 
Filesystem location for Asterisk agi files [/var/lib/asterisk/agi-bin]: 
Location of the Asterisk spool directory [/var/spool/asterisk]: 
Location of the Asterisk run directory [/var/run/asterisk]: 
Location of the Asterisk log files [/var/log/asterisk]: 
Location of the FreePBX command line scripts [/var/lib/asterisk/bin]: 
Location of the FreePBX (root) command line scripts [/usr/sbin]: /usr/bin
Location of the Apache cgi-bin executables [/var/www/cgi-bin]: /srv/http/cgi-bin
Directory for FreePBX html5 playback files [/var/lib/asterisk/playback]: 
Assuming you are Database Root
Checking if SELinux is enabled...Its not (good)!
Reading /etc/asterisk/asterisk.conf...Done
Checking if Asterisk is running and we can talk to it as the 'asterisk' user...Yes. Determined Asterisk version to be: 16.1.1
Checking if NodeJS is installed and we can get a version from it...Yes. Determined NodeJS version to be: 11.8.0
Preliminary checks done. Starting FreePBX Installation
Checking if this is a new install...Yes (No /etc/freepbx.conf file detected)
Database Root installation checking credentials and permissions..Connected!
Initializing FreePBX Settings
Finished initalizing settings
Copying files (this may take a bit)....
 18465/18465 [============================] 100%
Done
bin is: /var/lib/asterisk/bin
sbin is: /usr/sbin
Finishing up directory processes...Done!
Running variable replacement...Done
Creating missing #include files...Done
Setting up Asterisk Manager Connection...Done
Running through upgrades...
Checking for upgrades..
No further upgrades necessary
Finished upgrades
Setting FreePBX version to 15.0.5.2...Done
Writing out /etc/amportal.conf...Done
Writing out /etc/freepbx.conf...Done
Chowning directories...
PHP Warning:  require_once(/srv/http/admin/bootstrap.php): failed to open stream: No such file or directory in /etc/freepbx.conf on line 9

Warning: require_once(/srv/http/admin/bootstrap.php): failed to open stream: No such file or directory in /etc/freepbx.conf on line 9
PHP Fatal error:  require_once(): Failed opening required '/srv/http/admin/bootstrap.php' (include_path='.:/usr/share/pear') in /etc/freepbx.conf on line 9

Fatal error: require_once(): Failed opening required '/srv/http/admin/bootstrap.php' (include_path='.:/usr/share/pear') in /etc/freepbx.conf on line 9

In Process.php line 239:
                                                     
  The command "/usr/bin/fwconsole chown" failed.     
                                                     
  Exit Code: 255(Unknown error)                      
                                                     
  Working directory: /scratch/git/freepbx/framework  
                                                     
  Output:                                          
  Error Output:                                                                         

install [--dbengine DBENGINE] [--dbname DBNAME] [--dbhost DBHOST] [--cdrdbname CDRDBNAME] [--dbuser DBUSER] [--dbpass DBPASS] [--user USER] [--group GROUP] [--dev-links] [--skip-install] [--webroot WEBROOT] [--astetcdir ASTETCDIR] [--astmoddir ASTMODDIR] [--astvarlibdir ASTVARLIBDIR] [--astagidir ASTAGIDIR] [--astspooldir ASTSPOOLDIR] [--astrundir ASTRUNDIR] [--astlogdir ASTLOGDIR] [--ampbin AMPBIN] [--ampsbin AMPSBIN] [--ampcgibin AMPCGIBIN] [--ampplayback AMPPLAYBACK] [-r|--rootdb] [-f|--force]

It seems like the bootstrap.php file, which is located at ./amp_conf/htdocs/admin/bootstrap.php, does not get copied by the install script. The expected location is set in the freepbx.conf file:

[alarm@odroid framework]$ cat /etc/freepbx.conf 
<?php
$amp_conf['AMPDBUSER'] = 'freepbxuser';
$amp_conf['AMPDBPASS'] = '****';
$amp_conf['AMPDBHOST'] = 'localhost';
$amp_conf['AMPDBNAME'] = 'asterisk';
$amp_conf['AMPDBENGINE'] = 'mysql';
$amp_conf['datasource'] = ''; //for sqlite3

require_once('/srv/http/admin/bootstrap.php');
?>

Any ideas how to fix this?
What is the expected behaviour of the install script?

Thanks for your help.
Alexander


(Tom Ray) #2

So yeah, this isn’t going to work because FreePBX is going to want to own the system. Meaning it wants to run things as root when needed, be able to update files and other parts of the system. This needs to be a dedicated system to be a PBX. This is not something you can just slap on your Arch server that you have as your home server for media, apps and what not. Not going to work.

Case in point, FreePBX is designed to expect and want certain directory structures. Everything is coded with the logic that the GUI files reside in /var/www/html.

So as of now there is no official or unofficial (that I know of) Arch Manual Install instructions so nothing has been tested to see what works and what doesn’t on Arch. Even moreso, if you look at the Wiki the CentOS, Debian and Ubuntu all follow the same logic in regards to the install. Even the FreeBSD port follows this more that what you have.


#3

The output of

./install --help

includes the option of

–webroot=WEBROOT Filesystem location from which FreePBX files will be served [default: “/var/www/html”]

and

https://wiki.archlinux.org/index.php/Apache_HTTP_Server

So one option would be to change either your webroot to /var/www/html/ or ./install --webroot=/srv/http/

My guess is the first option is likely to be more robust.

You also need to make sure that your web server is running with user and group asterisk


(Alexander Pohl) #4

Dear dicko,

Runnung the install script with the webroot parameter seems to be ignored:

[root@odroid framework]# ./install --webroot=/srv/http
Database engine [mysql]:
Database name [asterisk]:
Database server address [localhost]:
CDR Database name [asteriskcdrdb]:
Database username [root]:
Database password: ****
File owner user [asterisk]:
File owner group [asterisk]:
Filesystem location from which FreePBX files will be served [/var/www/html]:

In my understanding the ./install commandline options should not be ignored or at least pre seeded with the value given on the command line (i.e /srv/http and not the default /var/www/html/ in my case). I will take a look at the php code. However my php knowledge is limited.

In the meantime I quickly installed a Debian VM and followed the FreePBX installation instructions on the wiki. The installer is doing a lot of stuff and I reached the to the end without errors. So I have to figure out what is going wrong with the Arch install.

Thanks anyway for your comments.
Alexander


#5

Did you try to override the question about “Filesystem location from which FreePBX files will be served [/var/www/html]:” ?

Otherwise take that to FreePBX, but as I stated, it is probably easier and better to have your apache server
DocumentRoot set to /var/www/html for any number of reasons


(system) closed #6

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.