1. Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 07, 2009
- 1277 views
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
2. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by ghaberek (admin) Jul 07, 2009
- 1189 views
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 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.
Which web server are you running?
-Greg
3. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 07, 2009
- 1281 views
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.
4. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 07, 2009
- 1415 views
ARG! I posted the wrong website for you, sorry. I'm a bozo today.
http://www.mikesjunkyard.com is the correct site.
5. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 07, 2009
- 1254 views
- Last edited Jul 08, 2009
According to os.e getenv is a "built-in" function.
6. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 07, 2009
- 1239 views
- Last edited Jul 08, 2009
Simple command line script, I run
puts(1, getenv("EUDIR"))
And I get zip. :(
7. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 07, 2009
- 1194 views
- Last edited Jul 08, 2009
If I do an "echo $EUDIR" at the bash prompt it returns "/Applications/euphoria" as it should.
8. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 07, 2009
- 1255 views
- Last edited Jul 08, 2009
Hmmm... now my scripts are returning EUDIR and PATH... but... *sigh*. I'm about ready to give up for now.
9. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by euphoric (admin) Jul 07, 2009
- 1208 views
- Last edited Jul 08, 2009
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.
Does that URL resolve to your own server at home or do you host with somebody who uses Mac servers?
10. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by euphoric (admin) Jul 07, 2009
- 1302 views
- Last edited Jul 08, 2009
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.
Anyway, don't get an error message there either.
11. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 08, 2009
- 1281 views
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.
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.
12. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 08, 2009
- 1194 views
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.
13. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by jimcbrown (admin) Jul 08, 2009
- 1314 views
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.
14. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by jeremy (admin) Jul 08, 2009
- 1506 views
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
15. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 08, 2009
- 1255 views
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?
16. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by jeremy (admin) Jul 08, 2009
- 1209 views
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
17. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 08, 2009
- 1148 views
Where should the .conf file go? The same location as the EUI binary?
18. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 08, 2009
- 1166 views
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.
19. Re: Is anyone else doing CGI on Mac OS X 10.5.7, Euphoria 4.x?
- Posted by Tuishimi Jul 14, 2009
- 1261 views
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*