The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Resolved] warn [whostmgr5] program "filename" is not executable at

Discussion in 'cPanel Developers' started by flycast, Nov 28, 2013.

  1. flycast

    flycast Member

    Joined:
    Feb 20, 2011
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    I am new to hooks...
    I have created a test script and have registered it OK:
    Code:
    Whostmgr:
            Accounts::Create:
                    stage: post
                    escalateprivs: 0
                    weight: 100
                    id: JAJ7sd3tZSYHqroB0nap3iXw
                    exectype: script
                    hook: createWordpress.php
    
    The script has the following attributes:
    My simple test code looks like this:
    PHP:
    #!/usr/bin/php
    <?php
    $describe 
    = array(
        array(
            
    'namespace' => 'Whostmgr',
            
    'function'  => 'Accounts::Create',
            
    'stage'     => 'post',
            
    'hook'      => 'createWordpress.php',
        ),
    );

    if ( 
    in_array('--describe'$argv) ) {
        print 
    json_encode($describe);
        exit();
    }

    function 
    hook() { 
      
    error_log("Hello");
      return 
    TRUE;
    }
    ?>
    I am getting the following error in the error log:
    Code:
    [2013-11-28 21:12:29 -0600] info [whostmgr5] ---debug_hooks---
    [2013-11-28 21:12:29 -0600] info [whostmgr5]             msg: Beginning execution of script hook.
    [2013-11-28 21:12:29 -0600] info [whostmgr5]         context: Whostmgr::Accounts::Create
    [2013-11-28 21:12:29 -0600] info [whostmgr5]           stage: post
    [2013-11-28 21:12:29 -0600] info [whostmgr5]           point: main
    [2013-11-28 21:12:29 -0600] info [whostmgr5]              id: JAJ7sd3tZSYHqroB0nap3iXw
    [2013-11-28 21:12:29 -0600] info [whostmgr5]            hook: createWordpress.php
    [2013-11-28 21:12:29 -0600] info [whostmgr5]   escalateprivs: 0
    [2013-11-28 21:12:29 -0600] info [whostmgr5]          weight: 100
    [2013-11-28 21:12:29 -0600] info [whostmgr5]            data: { <snip>}
    [B][2013-11-28 21:12:29 -0600] warn [whostmgr5] program "createWordpress.php" is not executable at /usr/local/cpanel/Cpanel/Hooks.pm line 199[/B]
            Cpanel::Hooks::exec_script('main', HASH(0x10080810), HASH(0x101b3a30), HASH(0x25e8d90)) called at /usr/local/cpanel/Cpanel/Hooks.pm line 112
            Cpanel::Hooks::exec_hook('main', HASH(0x10080810), HASH(0x101b3a30), HASH(0x25e8d90)) called at /usr/local/cpanel/Cpanel/Hooks.pm line 53
            eval {...} called at /usr/local/cpanel/Cpanel/Hooks.pm line 48
            Cpanel::Hooks::hook(HASH(0x101b3a30), HASH(0x25e8d90)) called at /usr/local/cpanel/Whostmgr/Accounts/Create.pm line 1583
            Whostmgr::Accounts::Create::_wwwacct( <snip>) called at /usr/local/cpanel/Whostmgr/Accounts/Create.pm line 1953
            Whostmgr::Accounts::Create::__createaccount( <snip>) called at /usr/local/cpanel/Whostmgr/Accounts/Create.pm line 2004
            Whostmgr::Accounts::Create::_createaccount( <snip>) called at whostmgr/bin/whostmgr5 line 609
            main::wwwacct() called at whostmgr/bin/whostmgr5 line 233
    [2013-11-28 21:12:29 -0600] info [whostmgr5] HOOK INFO: hook createWordpress.php did not output any data
    [2013-11-28 21:12:29 -0600] info [whostmgr5] ---debug_hooks---
    [2013-11-28 21:12:29 -0600] info [whostmgr5]             msg: Finished execution of script hook.
    [2013-11-28 21:12:29 -0600] info [whostmgr5]         context: Whostmgr::Accounts::Create
    [2013-11-28 21:12:29 -0600] info [whostmgr5]           stage: post
    [2013-11-28 21:12:29 -0600] info [whostmgr5]          result: 1
    [2013-11-28 21:12:29 -0600] info [whostmgr5]           point: main
    [2013-11-28 21:12:29 -0600] info [whostmgr5]              id: JAJ7sd3tZSYHqroB0nap3iXw
    [2013-11-28 21:12:29 -0600] info [whostmgr5]            hook: createWordpress.php
    [2013-11-28 21:12:29 -0600] info [whostmgr5]   escalateprivs: 0
    [2013-11-28 21:12:29 -0600] info [whostmgr5]          weight: 100
    [2013-11-28 21:12:29 -0600] info [whostmgr5]            data: <snip>}
    
    I need help. Why is my script not executing?
    By the way the data that I cut out at the locations <snip> looks like real data from the account creation process.,
     
  2. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    re: [Resolved] warn [whostmgr5] program "filename" is not executable at

    You need to put the full path to the script, not just the name here:

    Code:
    $describe = array(
        array(
            'namespace' => 'Whostmgr',
            'function'  => 'Accounts::Create',
            'stage'     => 'post',
            'hook'      => '[B]/full/path/to/createWordpress.php[/B]',
        ),
    );
    
     
Loading...
Similar Threads - [Resolved] warn [whostmgr5]
  1. MattDr2
    Replies:
    3
    Views:
    456

Share This Page