What are you trying to do? If you want your PHP code to access MySQL, that's already built in to PHP. Likewise, C++ can interface to MySQL directly.
[edit - added this after updating question from comment - Peter-in-2780]
You do not need to do anything to hide php code from visitors to your site. For example, have a look at
this[
^] That site is running on a computer within a metre of where I'm sitting, and I bet you can't see any of the PHP that generates the page or the MySQL database that stores everything. This is running on a very straightforward WAMP setup. There is no C++ involved. If you really need it, I can show you some bits of my Apache and PHP config.
[/edit]
[edit2 fixed URL in link /]