PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
The only way you are going to do it with php only (ie, no .htaccess or modifying the conf of apache) is to make a file called index.php and place it in a directory /product/name/xzy/q/service and tell it to call /product.php?name=zyx&q=service
And you will have do this for EVERY item you want mapped over.
In short. You can't. PHP scripts can only run when they are called, so you either need an actual php file to call, or you have to do a rewrite rule to tell it to call it for set conditions.
You could make a PHP file that handles 404 errors. It can then parse the requested /product/name/xyz/q/service rebuild the query string and redirect to /product.php?name=zyx&q=service
However you will have to either go into your cPanel or .htaccess to tell Apache where to find your PHP script for handling 404 errors.