Where to put it (header.php).
Open up header.php from your theme files and immediately after
<head> tag paste this code
<?php phpinfo(); ?>. Now when you visit your site you can see a tremendous amount of information about your server to troubleshoot any issues you may be having.
What PHP Version WordPress Requires.
At the time of writing this article the PHP version WordPress requires is 5.2.4 or greater. For more information visit WordPress Requirements page.