1. Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

The code below is returning nothing. My request parsing code is not working either... even if I hard code the request method first.

Not sure what is going on, this was working on Windows with Euphoria 3.1.1. I admittedly did not try 4.x on Windows for this.

global constant GET_ = "GET" global constant POST_ = "POST" constant REQUEST_METHOD = "REQUEST_METHOD" constant QUERY_STRING = "QUERY_STRING"

function get_request_method() Returns POST or GET. OR nothing at all.

object method

method = getenv(REQUEST_METHOD)

if atom(method) then method = {} end if

return method end function

new topic     » topic index » view message » categorize

2. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

Tuishimi said...

The code below is returning nothing. My request parsing code is not working either... even if I hard code the request method first.

Not sure what is going on, this was working on Windows with Euphoria 3.1.1. I admittedly did not try 4.x on Windows for this.

Don't forget your <eucode> tags...

global constant GET_ = "GET"
global constant POST_ = "POST" 
constant REQUEST_METHOD = "REQUEST_METHOD" 
constant QUERY_STRING = "QUERY_STRING" 
 
function get_request_method() 
    -- Returns POST or GET.  OR nothing at all. 
 
    object method 
 
    method = getenv(REQUEST_METHOD) 
 
    if atom(method) then 
        method = {} 
    end if 
	 
    return method 
end function 

Sorry I'm not much more help than that. sad

Which web server are you running?

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

Sorry. Yeah that was messy to look at, wasn't it.

I am running Apache2 (under MAMP).

It sees the euphoria interpreter. http://www.candiazoo.com but when it tries to see the env stuff I get nothing, so I throw up the error page you see.

I thought I had read somewhere that Mac OS X does not supply ENV data the same way as linux does... that something special has to be done. I think I read that on a Perl forum where the supporters had removed the getenv functionality because it was not ubiquitous across platforms, and people were upset so they put it back in, but something special had to be done for OS X.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

ARG! I posted the wrong website for you, sorry. I'm a bozo today.

http://www.mikesjunkyard.com is the correct site.

new topic     » goto parent     » topic index » view message » categorize

5. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

According to os.e getenv is a "built-in" function.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

Simple command line script, I run

puts(1, getenv("EUDIR")) 

And I get zip. :(

new topic     » goto parent     » topic index » view message » categorize

7. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

If I do an "echo $EUDIR" at the bash prompt it returns "/Applications/euphoria" as it should.

new topic     » goto parent     » topic index » view message » categorize

8. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

Hmmm... now my scripts are returning EUDIR and PATH... but... *sigh*. I'm about ready to give up for now.

new topic     » goto parent     » topic index » view message » categorize

9. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

Tuishimi said...

It sees the euphoria interpreter. http://www.candiazoo.com but when it tries to see the env stuff I get nothing, so I throw up the error page you see.

I hate to be the bearer of bad news, but I don't see an error page at that URL. smile

Does that URL resolve to your own server at home or do you host with somebody who uses Mac servers?

new topic     » goto parent     » topic index » view message » categorize

10. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

Tuishimi said...

ARG! I posted the wrong website for you, sorry. I'm a bozo today.

http://www.mikesjunkyard.com is the correct site.

I guess I should read ALL messages before posting. grin

Anyway, don't get an error message there either.

new topic     » goto parent     » topic index » view message » categorize

11. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

euphoric said...
Tuishimi said...

It sees the euphoria interpreter. http://www.candiazoo.com but when it tries to see the env stuff I get nothing, so I throw up the error page you see.

I hate to be the bearer of bad news, but I don't see an error page at that URL. smile

Does that URL resolve to your own server at home or do you host with somebody who uses Mac servers?

It's my own machine. This particular site is just for me to much around with... hence I wrote a controller, template manager in Euphoria. I had been running Windows 7 for the past 6 months and it has been working fine, then I decided to go back to OS X.

Well, for now, until I either rewrite it or figure it out, I can hard code the query string parameters to always point to the index page.

new topic     » goto parent     » topic index » view message » categorize

12. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

Installed the latest EUBINs. Still no change. I wrote a Perl script alongside it, that does the same thing (as far as the initial controller loading the ini file and extracting URL parameters) and it works. So the data is there from Apache. Not sure why Euphoria is not getting it back.

Euphoria DOES seem to be able to extract environment variables from the command line (in Terminal). Just not running as CGI.

new topic     » goto parent     » topic index » view message » categorize

13. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

Tuishimi said...

Installed the latest EUBINs. Still no change. I wrote a Perl script alongside it, that does the same thing (as far as the initial controller loading the ini file and extracting URL parameters) and it works. So the data is there from Apache. Not sure why Euphoria is not getting it back.

Euphoria DOES seem to be able to extract environment variables from the command line (in Terminal). Just not running as CGI.

Based on http://www.digitaledgesw.com/node/31 and a few other web pages that I foudn with google...

It is likely that apache runs as a different user than the user you run the shell on. So stuff in any .plist file or in .profile/.bash_profile/etc will not show up. (Only env vars set in /etc/launchd.conf are truly global.)

Even so, I'd expect apache's own CGI env vars to show up without issue.

new topic     » goto parent     » topic index » view message » categorize

14. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

jimcbrown said...

Based on http://www.digitaledgesw.com/node/31 and a few other web pages that I foudn with google...

It is likely that apache runs as a different user than the user you run the shell on. So stuff in any .plist file or in .profile/.bash_profile/etc will not show up. (Only env vars set in /etc/launchd.conf are truly global.)

Even so, I'd expect apache's own CGI env vars to show up without issue.

That is true. You must set EUDIR as a system wide env variable, using mod_env w/apache or simply put a euinc.conf file in the local directory (which is what I'd do as it will work anywhere). An example euinc.conf file would be:

-batch 
-i /Applications/Euphoria/include 
-i /Users/me/custom/euinc/dir 

The -batch causes it to not issue the "Press ENTER to continue" error message when an error does happen. The euinc.conf file will accept any command line argument to euphoria.

Then setup your actual cgi app such as:

#!/usr/bin/env eui 
 
-- Code here 

Jeremy

new topic     » goto parent     » topic index » view message » categorize

15. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

jimcbrown said...
Tuishimi said...

Installed the latest EUBINs. Still no change. I wrote a Perl script alongside it, that does the same thing (as far as the initial controller loading the ini file and extracting URL parameters) and it works. So the data is there from Apache. Not sure why Euphoria is not getting it back.

Euphoria DOES seem to be able to extract environment variables from the command line (in Terminal). Just not running as CGI.

Based on http://www.digitaledgesw.com/node/31 and a few other web pages that I foudn with google...

It is likely that apache runs as a different user than the user you run the shell on. So stuff in any .plist file or in .profile/.bash_profile/etc will not show up. (Only env vars set in /etc/launchd.conf are truly global.)

Even so, I'd expect apache's own CGI env vars to show up without issue.

I've placed EUDIR defs in csh.cshrc, profile and envvars (under Apache2/bin). Euphoria seems to be working fine for the most part - just not getting environment variables when running as CGI... I really don't get it unless it DOES have something to do with path variables - but I copied entire "Includes" directory into my CGI-BIN folder... I don't know.

Anyone else running apache2 (MAMP would be better) that could slap a quick script into their cgi-bin that spits out the environment variables?

new topic     » goto parent     » topic index » view message » categorize

16. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

The forum is running under Apache and it will not spit out EUDIR or other user based env vars. They have to be placed in /etc/profile not any one user directory. The way I got around this was to use the euinc.conf file as described above.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

17. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

Where should the .conf file go? The same location as the EUI binary?

new topic     » goto parent     » topic index » view message » categorize

18. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

Alright. Tried the conf. It finds it in /etc/euphoria... but it does NOT like the -batch option and barfs with it.

I did add the include directories but no difference.

new topic     » goto parent     » topic index » view message » categorize

19. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?

O.K. Honestly, I have no idea what I did, but I have my Euphoria-driven site back up and running. I swear I did nothing (that's what all users say, eg?)... I started re-implementing in IO, then decided to go BACK to my Euphoria sources (time machine) and it is working.

I don't know what idiocy I committed but did not recognize and I don't care. I am just happy it is working again. *sigh*

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu