Is it possible to Hello world on a server
Re: Is it possible to Hello world on a server
Thank you Julcar I tried your idea and same results.
Has anyone tried to do this before with any success?
Has anyone tried to do this before with any success?
Re: Is it possible to Hello world on a server
owen,
what sort of FTP-client are you using to upload and chmod?
what sort of FTP-client are you using to upload and chmod?
Re: Is it possible to Hello world on a server
Filezila.
I chmod the binary to 755
Also when I upload the binary I upload it using binary transfer type
I chmod the binary to 755
Also when I upload the binary I upload it using binary transfer type
Re: Is it possible to Hello world on a server
7 = all rights
can't remember the other (numerical) details ... except ordering:
user -- group -- world
I think that world needs: read/execute (nothing else)
Reason user is usually: "anonymous" (the user with a browser, accessing web-server)
can't remember the other (numerical) details ... except ordering:
user -- group -- world
I think that world needs: read/execute (nothing else)
Reason user is usually: "anonymous" (the user with a browser, accessing web-server)
Re: Is it possible to Hello world on a server
Errata, I just remember that my code needs an empty PRINT in the second line, just after sending the content type and before the first html tagowen wrote:Thank you Julcar I tried your idea and same results.
Has anyone tried to do this before with any success?
Code: Select all
PRINT ""
Re: Is it possible to Hello world on a server
Why would that matter? Maybe. It' a cgi thing.. Any how I will give it a try.
Re: Is it possible to Hello world on a server
Next test...
Try to compile on a vps
...
I get segmentation fault core dumped just running fbc
Try to compile on a vps
...
I get segmentation fault core dumped just running fbc
Re: Is it possible to Hello world on a server
what just happened?owen wrote:Eureka
did the binary cgi run on your shared hosting?
Re: Is it possible to Hello world on a server
Well I couldn't get it to work on shared hosting. So I got a vps
Re: Is it possible to Hello world on a server
Oh and I'm not using cgi. The binary is in the same folder as the php and source code
Re: Is it possible to Hello world on a server
That binary was compiled using centos on my laptop. Next I will try to compile it using ubuntu and see if it runs on the server
Re: Is it possible to Hello world on a server
check it out http://fbcadcam.org/fbs/fbs.php
fbs.php
calls (runs) fbs
which interprets / runs test.bas
test.bas
fbs.php
Code: Select all
<?php
$output = shell_exec("./fbs");
echo "<pre>$output</pre>";
?>
which interprets / runs test.bas
test.bas
Code: Select all
dim as integer i
for i = 1 to 10
print i
print "this is a test of fbs"
next
Re: Is it possible to Hello world on a server
My goal was to figure out how to Hello world on a server in linux so that i could ultimately do some fun stuff like fbs.
Thanks to the FB community for helping me along my adventure.
To know more about my fbs, links to the project are at https://www.fbcadcam.net/forum/viewforum.php?f=19
In summary:
I finally learned how to install freeBASIC on linux and compile my simple programs ie. programs not using any libraries. I hope to learn more about this using some of the libraries.
The instructions provided in the freeBASIC linux distribution readme.txt file work. For me all I really needed to do was simply read them and do as they suggest. The harder part for me was learning how to use linux itself and how to deal with multi boot stuff and linux server stuff.
What a joy it is to finally be able to use the freeBASIC compiler on linux.
Regarding the question: Does it matter which linux distro / flavor is use to compile my source_code.bas with fbc and ultimately run it on centos (ie bluehost's servers) is NO, it did not matter. I was able to compile and run my binary regardless if my os was ubuntu or centos on my laptop. Also i imagine it Does Not Matter in the case you you just want your binary to run on a linux desktop. I would answer this question myself by way of further testing specially with the likes of DSL (oh boy DSL looks awesome, not so small now). But I'll save that for another time.
Thanks to the FB community for helping me along my adventure.
To know more about my fbs, links to the project are at https://www.fbcadcam.net/forum/viewforum.php?f=19
In summary:
I finally learned how to install freeBASIC on linux and compile my simple programs ie. programs not using any libraries. I hope to learn more about this using some of the libraries.
The instructions provided in the freeBASIC linux distribution readme.txt file work. For me all I really needed to do was simply read them and do as they suggest. The harder part for me was learning how to use linux itself and how to deal with multi boot stuff and linux server stuff.
What a joy it is to finally be able to use the freeBASIC compiler on linux.
Regarding the question: Does it matter which linux distro / flavor is use to compile my source_code.bas with fbc and ultimately run it on centos (ie bluehost's servers) is NO, it did not matter. I was able to compile and run my binary regardless if my os was ubuntu or centos on my laptop. Also i imagine it Does Not Matter in the case you you just want your binary to run on a linux desktop. I would answer this question myself by way of further testing specially with the likes of DSL (oh boy DSL looks awesome, not so small now). But I'll save that for another time.