check apache running port ubuntu

C++
<?php
phpinfo();
Source

Also in C++: