qiby Do you need multiple versions of PHP installed at the same time? Normally I'd just say you could type 'php --ini' at the command line and look for the "Loaded configuration file" entry, but Apache might be using a different version to CLI.
If you make a phpinfo file, you'll find an entry near the top which should tell you the version in use by Apache. Remember to delete this file afterwards, as it displays quite a lot of info that would be useful to a less reputable visitor!
Edit: also, make sure to back up the php.ini file before changing it. If you make a mistake, it can cause more issues than you started with.
Edited to clarify: a phpinfo file is a .php file in your web directory that contains simply the following:
<?php
phpinfo();
?>
Just access it via your browser and it'll tell you all sorts of useful info