How to reload asterisk dialplan

How can I reload the asterisk dialplan as my www user ‘www-data’?

This works from the command line as root: asterisk -rx ‘dialplan reload’, but I can’t get that to run in my php script.

In my php script: system(“asterisk -rx ‘dialplan reload’”); <------ that doesn’t appear to work!

Connect via AMI and do that.

Thank you; I’m afraid I’m not quite sure how to accomplish this. I read the page you sent, but I’m still a little confused.