<?php
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
No output on\in page.
why is that? and what to do to see the error page?
You're not seeing any output because you haven't created any. The body of a 404 not found page isn't magically created for you simply by throwing a 404. If you want a nice-looking "Not Found" page, you have to actually build it. (Or tell your web server where to find it.) Note that the header value is what makes a 404 page. The content of (or even the presence of) the body is irrelevant.
In your second example, the page is generated by Apache because it couldn't find the requested file. In your first example, the file was found, and executed, and it generated no output.
If you want to design a nice custom 404 page, you can put your pretty content into this file, and then set it to be the default error handler for your whole site by using ErrorDocument 404 /404.php
in your Apache config. Then, whenever you request a page that doesn't exist, you'll get this page instead.