Recent

Author Topic: FPWebModule test on macOS  (Read 3251 times)

hventura

  • Newbie
  • Posts: 4
FPWebModule test on macOS
« on: April 18, 2018, 01:42:08 pm »
Good day to all.
I'm new to the forum and new to pascal and lazarus.
I'm currently on a Course of Programming and one of the classes is abaut Pascal and my teacher started using Lazarus.
We are making some web modules and in windows i can "run" the executable and access to 127.0.0.1 to show the onRequest response, or access 127.0.0.1/otherFunction to show "other pages".

At school i have access to a windows computer but at home i have a mac and i have lazarus instal. i followed the installation manual and i can program and run Applications.
But not the web modules.

My question is what do i have to do to test the web modules on a MacOS?
I have XAMPP installed, up and running.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: FPWebModule test on macOS
« Reply #1 on: April 18, 2018, 02:36:42 pm »
My question is what do i have to do to test the web modules on a MacOS?
I have XAMPP installed, up and running.

Apache comes preinstalled on Macs, so you shouldn't need to install XAMPP unless you need MySQL, etc.

I don't use FPWebModule, but CGI apps and Web apps in general are easy to create on Mac:

https://macpgmr.github.io

Local server testing can be done by putting binaries under /Library/WebServer/CGI-Executables and HTML docs under /Library/WebServer/Documents.

hventura

  • Newbie
  • Posts: 4
Re: FPWebModule test on macOS
« Reply #2 on: April 18, 2018, 03:45:13 pm »
Thank you, was very helpfull for future projects! i will read more about creating on XCode :)
PS: Yes i do have Xampp because of mySQL!

Still, i was wondering if it is possible to test (and how to) a FPWebModule on a MacOS. I need this because in school i code in Lazarus and test in on local computer (Windows) and at home, i would like to continue the working and test it on my MacOS.

In Windows i code the module, i compile it and creates an executable file, i execute it and it enables me to test all on http//localhost;
Is it possible in MacOS or what type of project do i have to create to simply code the module and test it on localhost?
 

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: FPWebModule test on macOS
« Reply #3 on: April 18, 2018, 03:51:34 pm »
Is it possible in MacOS or what type of project do i have to create to simply code the module and test it on localhost?

Copy the source files for your project from Windows to Mac, then open the project info file (.lpi) in Lazarus on Mac and try compiling and running it.

hventura

  • Newbie
  • Posts: 4
Re: FPWebModule test on macOS
« Reply #4 on: April 18, 2018, 05:46:09 pm »
In the picture there are the results of when i compile in windows (and the file i run) and when i compile in Mac.
When i compile AND run the same thing in Mac it does nothing..

I first thought it could be because of some apache configs to accept web modules but i don't understand much to know if it has anything to do with it.
It seams so easy on windows that i think i is easy on Mac too... just need to figure it out.

I tried to start apache manually "sudo apachectl start" but all i get is the default "It Works"..
As i'm really new to this i might be crossing subjects and be confused by something, for that im sorry for anything. And thanks for the patience!
 

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: FPWebModule test on macOS
« Reply #5 on: April 18, 2018, 05:58:04 pm »
In the picture there are the results of when i compile in windows (and the file i run) and when i compile in Mac.
When i compile AND run the same thing in Mac it does nothing..

I'm not sure if I understand what problem you're having.

It looks like it compiled fine on Mac (httpproject1 is your executable, analogous to httpproject1.exe on Windows).

What do you mean by running? In Lazarus? Nothing happens?

Note that sqlite.dll makes no sense on Mac - that's a Windows dynamic library. The Mac version is already installed (/usr/lib/libsqlite3.dylib). Might be a different problem that you haven't encountered yet.



hventura

  • Newbie
  • Posts: 4
Re: FPWebModule test on macOS
« Reply #6 on: April 19, 2018, 10:31:36 am »
By "compile and run" i was simply say that i click on the green arrow in Lazarus (that compiles and runs the code);

So dumb.. i was configuring it to port 80 and for some reason it was returning a Socket error.
I changed it to 8080 and it's working! :)

Thank you verry much for all! :D

 

TinyPortal © 2005-2018