I am new to hooks...
I have created a test script and have registered it OK:
The script has the following attributes:
I am getting the following error in the error log:
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.,
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
My simple test code looks like this:-rwxr-xr-x 1 root root 365 Nov 28 21:11 createWordpress.php*
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;
}
?>
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>}
By the way the data that I cut out at the locations <snip> looks like real data from the account creation process.,