XMPP class not found

1.1k views Asked by At

I want to create a XMPP client with php, I tried this code

<?php
include("xmpphp/XMPPHP/xmpp.php");
$conn = new XMPP('192.168.1.62', 5222, 'client', 'pass', 'xmpphp', 'cnx-pc',           $printlog=False, $loglevel=LOGGING_INFO);
$conn->use_encryption = False;
$conn->connect();
$conn->processUntil('session_start');
$conn->message('cnx', 'hi');
$conn->disconnect();
?>

but i have this fatal error Fatal error: Class 'XMPP' not found in D:\EasyPHP-5.3.3.1\www\xmpp1.php on line 3

Any one have an idea about the problem

1

There are 1 answers

3
cweiske On

The class name is XMPPHP, not XMPP. Use that, and the error will go away.

Also replace include with require since you rely on the class to exist.