You are not logged in.

#1 2008-06-30 05:56:01

hungsonbk
Member
Registered: 2007-05-26
Posts: 105
Website

[SOLVED]How to run PHP script in bash Shell

Hi,
I am trying to install freePBX, and I need to run a php script to install the program, But when I run this script, I got no respond as well as error message. In the Ubuntu PC, when the script is run, It will as for input information.

Did I miss somethings ?

Here is the header of the install_amp script :

#!/usr/bin/php -q
<?php

require_once ("libfreepbx.install.php");

# constants
define("AMP_CONF", "/etc/amportal.conf");
define("ASTERISK_CONF", "/etc/asterisk/asterisk.conf");
define("UPGRADE_DIR", dirname(__FILE__)."/upgrades");
define("MODULE_DIR", dirname(__FILE__)."/amp_conf/htdocs/admin/modules/");

# semi constants
$webroot    = "/var/www/html";
$fopwebroot    = "";                // if blank, will use $webroot/panel
$ampsbin_dir = "/usr/local/sbin";    // default if not set
$ampbin_dir = "/var/lib/asterisk/bin";
$asterisk_user    = "asteriskuser";
$asterisk_pass    = "amp109";


/*
freepbx versions
        '1.10.005',
        '1.10.006',
        '1.10.007beta1',
        '1.10.007beta2',
        '1.10.007',
        '1.10.007a',
        '1.10.008beta1',
        '1.10.008beta2',
        '1.10.008beta3',
        '1.10.008',
        '1.10.009beta1',
        '1.10.009beta2',
        '1.10.009',
        '1.10.010beta1',
        '1.10.010',
        '2.0beta1',
        '2.0beta2',
        '2.0beta3',
        '2.0beta4',
        '2.0beta5',
        '2.0.0',
        '2.0.1',
        '2.1beta1',
        '2.1beta2',
        '2.1beta3',
        '2.1.0',
        '2.1.1',
        '2.1.2',
        '2.1.3',
        '2.2.0beta1',
        '2.2.0beta2',
        '2.2.0beta3',
        '2.2.0rc1',
        '2.2.0rc2',
        '2.2.0rc3',
        '2.2.0',
        '2.2.1',
        '2.2.2',
        '2.2.3',
        '2.3.0beta1',
*/

/********************************************************************************************************************/

function out($text) {
    echo $text."\n";
}

Last edited by hungsonbk (2008-07-01 07:41:41)

Offline

#2 2008-06-30 17:10:01

ghostHack
Member
From: Bristol UK
Registered: 2008-02-29
Posts: 261

Re: [SOLVED]How to run PHP script in bash Shell

First question, what is the error message?

Offline

#3 2008-06-30 20:38:31

hungsonbk
Member
Registered: 2007-05-26
Posts: 105
Website

Re: [SOLVED]How to run PHP script in bash Shell

ghostHack wrote:

First question, what is the error message?

big_smile:D:D
As I said, when I run the command:
#./install_amp
#

I have no error. It didn't do anything. I have no response whether if I succeeded or not. But as I checked It didn't install any files. It just did nothing.

Offline

#4 2008-06-30 23:20:52

marxav
Member
From: Gatineau, PQ, Canada
Registered: 2006-09-24
Posts: 386

Re: [SOLVED]How to run PHP script in bash Shell

What are the error reporting settings in your php.ini file ?

Offline

#5 2008-07-01 03:58:20

hungsonbk
Member
Registered: 2007-05-26
Posts: 105
Website

Re: [SOLVED]How to run PHP script in bash Shell

marxav wrote:

What are the error reporting settings in your php.ini file ?

big_smile:D:D:D. Yes, I checked and turn the Error Report to on so now I got some error when running this script.

Thanks Marxav

Offline

Board footer

Powered by FluxBB