Re: embedded eu scrupting in a eu program?
- Posted by "Carl W." <euphoria at cyreksoft.yorks.com> Mar 03, 2003
- 559 views
Andy Serpa wrote: > gertie at visionsix.com wrote: > > mjaksen at subdimension.com wrote: > > > > > I am interested in using euphoria as the embedded scripting > > > language of a webserver to be written in euphoria. We already > > > have Peter Blue's basic webserver posted in "recent contribs". > > > > As far as i know, no one has been able to get a cgi script running > > on a linux box but Robert. I've done it on win95. > > I had no problems setting up Eu and running scripts on a Linux server. > Couple of different ones. While I work for the ISP that runs my cgi scripts, giving me a little more freedom to set things up, setting up Euphoria on a server to run CGI is a piece of cake - No changes were made to the internal config of the server to make it run. Just upload a copy of the PD exu interpreter to your cgi-bin and make the first line of the script: #!/path/to/webspace/cgi-bin/exu Make sure the permissions on both exu and your script are set so that both are executable for everyone. Also make sure the extensions to your Euphoria cgi scripts are understood by the server - an average server won't know whether '.exu' is a legal cgi extension. Use '.cgi' instead - most servers understand this. Proof of concept can be found at: http://www.cyreksoft.yorks.com/eu.cgi The script reads and prints its own source. > > > how do you run a script embedded in the web page without starting a > > > new instance of the interpreter? > > > > The bigger problem would be how the browser will run the script. > > You can put anything you want in the webpage. > > I'm assuming you are talking about server-side scripting like PHP? In > that case, the browser has nothing to do with it -- it is served > normal HTML, just dynamically generated by the script at the time of > the request. Most languages that can be embedded in webpages and run server-side (PHP, Perl, Ruby etc.) have a module that is installed for use with Apache or a DLL that is installed for use with MS IIS. Since there's no such thing as 'mod_euphoria', or 'rdseuph.dll' it would be up to Rob C. to create them. Imagine being able to: <b>Calculate and print the value in italic:</b> <[eu] integer i i = 2 i += 2 printf(1, "<i>i = %d</i><br>\n", i) [eu]> <b>Done!</b> And print something like: Calculate and print the value in italic: i = 4 Done! Carl -- [ Carl R White == aka () = The Domain of Cyrek = ] [ Cyrek the Illogical /\ www.cyreksoft.yorks.com ]