I can give you a little direction, and then the smarter guys will come behind me and correct/finish the answer.
You will find the php.ini file in /etc and you need to find a reference in it to what the RM told you (socket?). You can then edit the php.ini file to accomplish what you need and test. Look up php.ini on the internet to see all the attributes that can be set. Test it, if it works then you will need to create a template that will modify the php.ini each times the sme boots since the sme replaces that file during every boot. There are lots of threads about templates here.
As to port 54321, if it is an outgoing requetst, i.e. the sme is going out to the internet on that port, then as I understand it the sme blocks no outgoing ports except be exception rules. So that should work.