Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

converting C++ to PHP

New Here ,
Sep 02, 2008 Sep 02, 2008
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
TOPICS
Server side applications
820
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 02, 2008 Sep 02, 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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 02, 2008 Sep 02, 2008
Yes, I did that. Only the source code comes up on the web site. I must be missing something
very obvious.

nobabieswebsite
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 04, 2008 Sep 04, 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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 04, 2008 Sep 04, 2008
nobabieswebsite wrote:
> 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?

Create a page called test.php. It should contain the following script,
and nothing else:

<?php phpinfo(); ?>

Upload it to the server, and load the URL into a browser. If you see a
page of PHP configuration details, PHP is enabled, and you're doing
something wrong with the other stuff. If all you see is <?php phpinfo();
?>, PHP is not enabled. Contact the server administrator.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 04, 2008 Sep 04, 2008
LATEST
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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines