I haven't touched much perl since I picked up php in ~98, so I wanted to write postwwwacct in php. It worked fine from the shell.
(note: this isn't the finial script, but the test one I have reduced it to)PHP Code:#!/usr/bin/php -q
<?php
print "\n Running postwwwacct \n";
$message = "the arguments are\n\n\n";
foreach($argv as $key => $value)
{
$message .= "$key : $value \n";
}
mail('me@example.com, 'postwwwacct', $message);
?>
but then when I created an account I get this in WHM:
Ok, I thought, maybe it doesn't like how perl is passing its variables. so I wrote a perl postwwwaccct that looked like this:Code:wwwacct creation finished Status: 404 Content-type: text/html X-Powered-By: PHP/4.3.10 No input file specified.
it too, worked fine form the command line. passing the arguments like expected. But I still got the 404 error in WHM.Code:#!/usr/bin/perl print "Starting PostWWWAcct \n\n"; $stg = ""; foreach $varl (@ARGV) { $stg = $stg . $varl . " "; } print "$stg\n"; $phpcommand = "php.postwwwacct $stg"; print "$phpcommand\n"; system($phpcommand);
so tried variations on the $phpcommand:
$phpcommand = "./php.postwwwacct $stg";
$phpcommand = "/scripts/php.postwwwacct $stg";
$phpcommand = "/usr/bin/php -q /scripts/php.postwwwacct $stg";
each one working fine from the command line, but failing in WHM. I also played with permissions starting at 700, then 770, then (the dreaded) 777. All failed in the exact same way.
Obviously, I am missing some magic token or juju dance I need to do. I guess I could have the perl postwwwacct call a web page, but I would prefer to not have it be publicly accessible and there are some classes I already have written in php that I would like not to have to rewrite.
Any advice would be appreciated.



LinkBack URL
About LinkBacks
Reply With Quote






