Can not get postwwwacct to run
Hello,
I've been working on this a couple of days and can't seem to get this script to run on account creation in WHM. WHM says that it's running the file in the account creation output, but I'm not finding any evidence that the file is running.
I'm running WHM 11.38.2 (build 12)
Here's what I've tried:
1) I saved the postwwwacct file to: /usr/local/cpanel/scripts/
2) I set the execution bits with: chmod +x postwwwacct
3) Nothing is being written to the error log in: /usr/local/cpanel/logs/error_log or /usr/local/cpanel/logs/error_log_tommy
4) I've tried both #!/usr/local/bin/php and #!/usr/bin/php at the top of the file and neither seem to work.
5) I've tried ini_set('display_errors',1); and ini_set('display_errors',0); and that doesn't seem to make any difference.
Here's my code:
[PHP]#!/usr/local/bin/php
-
Hello :) Could you elaborate on what actions you would like to implement after account creation? Are you trying to set specific PHP values for individual accounts? Thank you. 0 -
Thanks for the quick reply! Just after I posted here I actually figured it out. The postwwwacct file that I uploaded had Windows end of line characters so I had to convert it to Unix encoding. After that it ran and logged my test error to my log file correctly on account creation. After I got it working, I was able to use the xml api to create a new db, db user, assign user privileges, and create a cron job from the script. All that works great. Now I'm trying to figure out how to update the email for the cron jobs on a user's account using the xml api. Any tips on how to do that? Thanks! Tommy 0 -
Thanks Tommy! I was also having the same issue, and your solution to "convert it to Unix encoding" because the file you "uploaded had Windows end-of-line characters" (EOL) that weren't being handled by the Unix/Linux processor. Basically, Windows uses CRLF and Unix/Linux uses CR. For other readers at this point, here is the solution for me to change/convert my Windows EOL files to Unix EOL files us the command "tr": Unix/Linux Command: tr -d '\015' < DOS-file > UNIX-file Example: tr -d '\015' < /home/user/test/postwwwacct > /usr/local/cpanel/scripts/postwwwacct Note that the name DOS-file is different from the name UNIX-file; if you try to use the same filename twice (overwrite the file), you will end up with no data in the original file. 0
Please sign in to leave a comment.
Comments
3 comments