Archive for January, 2008

Cpanel Account backup error

Saturday, January 19th, 2008

Error while trying to take the backup of an account.(internal death while parsing ) Sat Jan 19 12:36:56 2008 [15888] error: Timeout: Alarm at bin/postgresadmin.pl line 40.
main::_ANON_(’ALRM’) called at /usr/local/cpanel/Cpanel/PostgresAdmin.pm line 281
Cpanel::PostgresAdmin::listusers(’Cpanel::PostgresAdmin=HASH(0×848441c)’) called at bin/postgresadmin.pl line 288

Timeout: Alarm at bin/postgresadmin.pl line 40.
Password: ………

Fix:
as root run
mv -f /var/lib/pgsql /var/lib/pgsql.old

then run
yes | /scripts/installpostgres

Don’t forget to do:

WHM-> SQL Services ->Postgres Config->Postgres Config Install

and then

WHM-> SQL Services ->Postgres Config->Postgres Password

How to Send Email from a PHP Script

Saturday, January 12th, 2008

Using php mail() function to send emails from php script.

Send Email from a PHP Script Example :

The first argument to this function is the recipient, the second specifies the message’s subject and the third one should contain the body. So to send a simple sample message, we could use:

$to = "recipient@example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("

Message successfully sent!

“);
} else {
echo(”

Message delivery failed…

“);
}
?>

Save this file as mail.php and browse from url http://yourdomain/mail.php