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.

postwwwacct refuses to run

Discussion in 'cPanel Developers' started by Phelms215, Nov 12, 2011.

  1. Phelms215

    Phelms215 Member

    Joined:
    Aug 27, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hey Guys,

    I have the script below.. right now its just a basic test to get the postwwwacct to run..its one of a few scripts I am working on and sadly having trouble. The script runs perfectly when called via ssh but via WHM it just doesn't run though the green checkbox is the. I checked permissions and the file is in /usr/local/cpanel/scripts . . . if anyone has any advice that would be amazing.. thanks!

    Code:
    #!/usr/bin/php-cgi -q 
    <?php
    $ourFileName = "testFile.txt";
    $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
    fclose($ourFileHandle);
    ?>
    
     
  2. sirdopes

    sirdopes Well-Known Member
    PartnerNOC

    Joined:
    Sep 25, 2007
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    It is probably running but not creating the file testFile.txt in the spot that you are expecting. Does it work if you specify the full path?
     
  3. Phelms215

    Phelms215 Member

    Joined:
    Aug 27, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hey,

    I was able to get it done.. I had a typo in my script that wasn't referencing part of it from when cpanel was calling the script. Though when I called from the directory it worked fine. It is wroking now. Thanks Again!

    I have 1 last question, is there a script that runs when cpanel creates an addon domain, subdomain, ftp user or mysql database? thanks in advance!!!!
     
    #3 Phelms215, Nov 14, 2011
    Last edited: Nov 14, 2011
  4. sirdopes

    sirdopes Well-Known Member
    PartnerNOC

    Joined:
    Sep 25, 2007
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    The custom event handler is called during each of those i believe. The following page has some documentation and an example.

    Custom Event Handlers
     
  5. Phelms215

    Phelms215 Member

    Joined:
    Aug 27, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hey I looked into that area but since it's perl it might be a little bit harder for me to edit with PHP. I found function hooks and was attempting to use AddonDomain hook and what I did was created the addaddondomain file in /usr/local/cpanel/hooks/AddonDomain .. is that correct or is there somewhere else I would add it ?
     
  6. morissette

    morissette Well-Known Member

    Joined:
    May 24, 2009
    Messages:
    119
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Austin, TX
    cPanel Access Level:
    Root Administrator
    There is not a cPanel hook for use on Addon Domains (See: cPanel & WHM Script Hooks) so you would definitely need to use the custom event handlers as sirdopes pointed out.

    You should be able to use:

    type => post
    module => addondomain
    event => addaddondomain

    Then you could use Data::Dumper in perl or print_r/varDump in php
     
Loading...
Similar Threads - postwwwacct refuses run
  1. tgv
    Replies:
    5
    Views:
    244
  2. Sreejith S
    Replies:
    1
    Views:
    234

Share This Page