Ok, the first method won't work because it's not going through a web server, and lynx needs a web server to parse the PHP.
I don't know why the second method works...it should...is it password protected or something?
Another way to runit command line is to call PHP directly:
php /usr/local/etc/http/etc..../messages.php
You will need to compile PHP as a CGI if you don't have it already.
Diego