Skip to main content
Participant
September 2, 2008
Question

converting C++ to PHP

  • September 2, 2008
  • 2 replies
  • 816 views
I have written a few programs in C++. The language is no longer supported, but works well. I have a web page hosted by Godaddy. They would be happy to let me post the programs in executable form, but they cannot accept C++. It would be all right in PHP. I can paste the source code into a PHP file in Dreamweaver and the editor there checked it and found it was all right when I clicked "validate," which is no surprise because I know it works. However, when I try to put it on my web site, what gets posted is the source code. It is sort of like on of those irritating people who when asked, "Say your name." reply "your name." I downloaded something called "scriptolp" but I couldn't find a compile button there either.
So is it possible to compile a code in PHP, and if so how?

Thank you
nobabieswebsite
This topic has been closed for replies.

2 replies

Inspiring
September 4, 2008
you could always setup a testing sever on your development machine to run apache and php. that way you can be sure the code works without any godaddy issues.

I installed XAMPP ( http://sourceforge.net/projects/xampp/) with no problem.
Inspiring
September 2, 2008
nobabieswebsite wrote:
> So is it possible to compile a code in PHP, and if so how?

PHP is not a compiled language (at least not when you upload it to the
web server). You need to give the file a .php filename extension. Then a
PHP-enabled web server will compile it at runtime.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Participant
September 2, 2008
Yes, I did that. Only the source code comes up on the web site. I must be missing something
very obvious.

nobabieswebsite
Participant
September 4, 2008
It apears that the problem, at least one problem, is getting a program to run on the server at all. I wrote a file in php in a php file and uploaded it. It does not run. Again I only get the source code. No point in trying to convert from C++ if php doesn't run anyway. Any ideas?