Sessions on XAMPP no go, Live ok.[Headache]

Are you using LiveCode to create server scripts or CGIs?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

sphere
Posts: 1047
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Sessions on XAMPP no go, Live ok.

Post by sphere » Wed Nov 06, 2019 7:04 pm

Indeed it's cheaper than having a laptop or old desktop to do that and indeed they are fun. I will think about getting one for home.
I have an Odroid C2, but it belongs to my daughter playing movies with Kodi.

On my daily job, (doing the programming besides it with a small startup) i created an Rpi server with Linux which is used as server to display Project information on Android tablets at several workbenches in a lab.
And i have one with Raspbian which i use to build something using a stepper motor (Started a year ago almost, but stopped a while because of no time) and LC. But the motor responds to mouse movements, so maybe i need an separate add-on interface to the motor-board or start using some Python examples which i tried but could not get it to work yet.

For a server the new Rpi 4 with 4GB would be good i think then. Or an Odroid because they have versions which outrun the Rasp.

sphere
Posts: 1047
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Sessions on XAMPP no go, Live ok.

Post by sphere » Sun Nov 10, 2019 2:51 pm

OK i tried UwAmp(nice and maybe easier than xampp), but then it only worked on the first page and not the following page, then start session gave error.Althoug it was written to the sessions folder with sufficient rights.(and enabled action module)

Tried again with Xampp, putted the LC server in d:\server\xampp\cgi-bin and added this to httpd.conf (not in httpd-xampp.confin extras folder):
i changed something but i don't know exactly what anymore....something with addhandler/action

Code: Select all

#####################################livecode###################
<Directory "d:/server/xampp/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    AddHandler livecode-script .lc
    Action livecode-script /cgi-bin/livecode-community-server.exe
</Directory>
##########################livecode#################
<Directory  "d:/server/xampp/cgi-bin">
   Options ExecCGI
AllowOverride All
Require all granted
 </Directory>
 ScriptAlias /cgi-bin/livecode-community-server.exe "d:/server/xampp/cgi-bin/livecode-community-server.exe"
 ########################################################
Sessions work now on all pages :)

Thank you all.

sphere
Posts: 1047
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Sessions on XAMPP no go, Live ok.[Headache]

Post by sphere » Sun Nov 17, 2019 4:14 pm

There is really something wrong with the sessions (on XAMPP/LAMPP) which gives me a major frustrating headache.
All was working fine, i did not change a thing. Just 2 days not programming. Started it up and the browser gives the error again where the line start session is :evil: :evil: :evil: :evil: :evil: This costs a lot of time just trying to get/keep the sh*t running pffff, i'm about to give up on LC server. :cry: :cry: :cry:

So to check, i've setup LAMPP, all is working ok on Ubuntu Mate. I chown the cgi-bin and htdocs. Livecode server runs ok. test.lc is ok, put the time is working and showing the correct time.

run a script where sessions is used and error again.......
a piece of the script:

Code: Select all

<?lc
--set the sessionSavePath to the defaultfolder
--set the sessionSavePath to "d:/server/xampp/htdocs/myproject/temp/"  --windows 
set the sessionSavePath to "/opt/lampp/htdocs/myprojec/temp/" --linux
--set the sessionSavePath to "sestmp/" --live
set the sessionLifetime to 3600
set the sessionCookieName to "MYPROJECT"
set the sessionID to "SessionIdentifier"
start session
This what i see in the browser:
file "/opt/lampp/htdocs/myproject/index.lc"
row 9, col 1:


Most probably it's not even LC's fault, because the scripts run perfectly on live server, and as it was working it is worth pulling your hair out when it suddenly doesn't work, out of the blue.
or...........it was latest Win10 update which was in between, but then again, it does not work on Linux Ubuntu Mate either. Where was this order page of a raspberry to setup a little server...

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7733
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Sessions on XAMPP no go, Live ok.[Headache]

Post by FourthWorld » Sun Nov 17, 2019 4:41 pm

Have you successfully set up any other CGI program to work well in your XAMPP system?

And what changed been the time your XAMPP CGI setup worked and when it stopped?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

sphere
Posts: 1047
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Sessions on XAMPP no go, Live ok.[Headache]

Post by sphere » Sun Nov 17, 2019 8:28 pm

FourthWorld wrote:
Sun Nov 17, 2019 4:41 pm
Have you successfully set up any other CGI program to work well in your XAMPP system?
well i tried to use previous scripts which also did work and a sessions.lc in it's own folder, i see that lcsessions.idx get's written but not the other file.
FourthWorld wrote:
Sun Nov 17, 2019 4:41 pm
And what changed been the time your XAMPP CGI setup worked and when it stopped?
except a small win10 update, nothing.
So i set it up on Ubuntu Mate too and it's acting the same.

PHP sessions works flawless, i'm roughly guessing they are not interchangeable with lc's. (would be great though :mrgreen: )
Another thing i could try is too set up apache, php7x.x and mysql separate to see if that makes a difference

sphere
Posts: 1047
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Sessions on XAMPP no go, Live ok.[Headache]

Post by sphere » Sun Nov 17, 2019 10:08 pm

Got it running now using Easyphp, sessions work again.

Same entry in conf file except for the correct folders.

Makes me poco loco...hopefully it keeps working, thanks!

sphere
Posts: 1047
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Sessions on XAMPP no go, Live ok.[Headache]

Post by sphere » Sun Dec 08, 2019 6:13 pm

Finally got one version ready, it's the php version which i also have for about 80% in LC-server.
I spend to much time in a shopping-cart system(fixed/floating on the page) that ultimately did not work so now i used a simpler version. You can see a preview here if you like: https://multifoodshop.nl/nl/winkel-preview, so that mimics the Android App partly.

Still going further to have a LC-server version ultimately and will try to rewrite the php parts to lc. Most difficult part(for me) is the cart part.
But with trial and error i will find a way.

Being busy and seeing some php styles i noticed that i don;t need to capsulate all within <?lc ?>, what i mean is you can start a repeat loop like:
<?lc
repeat with x-1 to the number of lines of tL
?>
here some html stuff
and then further down the road
<?lc
end repeat
?>
i did not know that could be done, as i see it too with some php files.

Anyway i have some progress and easy-php is doing still great on the sessions stuff.

mrcoollion
Posts: 554
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: Sessions on XAMPP no go, Live ok.[Headache]

Post by mrcoollion » Mon Dec 09, 2019 7:36 am

Nice stuff (netjes gedaan :-).

Strange that UwAmp portable did not work as expected. I have tried it with very complex software and had no problems except I needed to have a certain DLL in the apache/bin directory (see below) which at first gave me some problems.
(I put the MSVCR110.dll in the apache/bin directory and it worked)

I am glad to see that you now have a working solution and are making progress....

Regards,

Paul

sphere
Posts: 1047
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Sessions on XAMPP no go, Live ok.[Headache]

Post by sphere » Mon Dec 09, 2019 3:08 pm

Bedankt Paul, thanks Paul, i appreciate it.

Maybe the dll is it, i don't know. I hope to rewrite the last page where the cart is to lc. In the end it has to communicate with the payment service for IDeal, which i also use in the Android app. But know it is working i'll take some more time for it, no hurry.

Groet, Jerry

Post Reply

Return to “CGIs and the Server”