First run this outside script sudo cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.bak.conf
Make sure, you have 2 php version installed on computer, and create 2 configuration httpd/apache file to easy change php version
After script created, save on home and use bashrc to create alias
e.g. alias switch-php=". ~/Script/switch_php.sh"
put on last line, restart bash, and excute switch-php 7
to change php to version 7, and switch-php 56
to change to php version 56