Actually you also know a little about Openfire ,so this is the key point .
In this case , Openfire is your IM Server and the php snippet is your IM client . Before you connect to your IM server you should make some configuration in Openfire admin console . As you said install Openfire locahost ,then start Openfire and visit in your browser http://localhost:9090/
, if you never do this step , this means you do not finish to setup Openfire . When you make configuration you will see the admin user setting and password and some other parameters . After this step , you can login to Openfire by your admin username and password .
If you want to more test user , pleas visit Openfire admin console again ,and click user tab to new more users .
my.server = localhost, home = any string you like , this the resource in XMPP usually we use client application version like spark 2.0 or xmpphp3.8 .