Recent

Author Topic: Develop on pascal script on Fedora and run on Ubuntu  (Read 5766 times)

ipkwena

  • Newbie
  • Posts: 4
Develop on pascal script on Fedora and run on Ubuntu
« on: September 17, 2010, 05:02:55 pm »
I have developed a cgi script with TSpiderForm on Fedora 12 and Lazarus 0.2.28.2-beta.  All works as expected with connections to local mysql. When I copy this fedora based script to cgi-bin directory on an Ubuntu 10.04 host, and try access the script via a browser, I get errors.

To isolate any DB related issues, I try to execute the script on CLI like "./test" - again it fails to execute complaining about absence of libmysqlclient-15 or so (I do not have the Ubuntu host with me right now).

Mysql is installed on the ubuntu host, but lazarus pascal is not. The question is:  if I develop a scipt on host A, what is required on host B to make it execute assuming host B would be my website hosting ISP?

Regards.

Chronos

  • Full Member
  • ***
  • Posts: 208
    • PascalClassLibrary
Re: Develop on pascal script on Fedora and run on Ubuntu
« Reply #1 on: September 17, 2010, 08:07:34 pm »
In some cases it could be possible to use symbolic link for newer library version to older. But generaly every linux distribution have their own concept regarding used versions in package system and release period so application compiled on one linux machine need not run on another.
If you want to use some hosting and own CGI appliaction I would suggest you tu rent some virtual private server (VPS) and compile your application directly on server using FPC and presented mysql libraries.
I have some physical servers with installed OpenVZ VPS virtualization software and I have some FPC CGI application running in VPS envrionment. I have plans to rework of my sites from PHP to pascal and achieve use of united programming language. Who can know well many different languages with complex libraries and frameworks than we do nearly everything with one powerfull language? I world of AJAX and high demands for complex software languages like PHP loose their benefits. No scripting is necessary, no simple stupid echo command and direct text tag printing is effective and safe. Intraweb for delphi and evan dev tools like Morfik show us effective way to develop rich applications for today needs.

irfanbagus

  • Jr. Member
  • **
  • Posts: 57
Re: Develop on pascal script on Fedora and run on Ubuntu
« Reply #2 on: September 17, 2010, 08:20:04 pm »
lazarus produce native applications, so your application should be called 'cgi binary' instead of 'cgi scripts'. basically there is no problem as long as you use the same platform (eg 32bit/64bit) and all required libraries are available.
for your problem, try to make sure you use the same version of mysql.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8103
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Develop on pascal script on Fedora and run on Ubuntu
« Reply #3 on: September 18, 2010, 08:50:12 am »
Library versioning problem definitely

ipkwena

  • Newbie
  • Posts: 4
Re: Develop on pascal script on Fedora and run on Ubuntu
« Reply #4 on: September 18, 2010, 09:03:32 am »
Thanks to all of you, in particular to irfanbagus and leledumbo. Your assistance helped me to consider installing the missing mysql library on Ubuntu. The original error message was a long string of text, of which the following was significant: "None of the dynamic libraries can be found: libmysqlclient.so.15, libmysqlclient.so.".

So I googled a little and found a post on how to install shared library "libmysqlclient.so.15". There after the binary cgi script works perfectly. The key thing I wanted to verify is that a freepascal cgi script developed on one linux platform can execute on another without the need of freepascal installation.

I am still evaluating chronos's suggestion for near future development possibilities.

Regards.