CGI and MySQL in LAMPP

Problems with the Linux version of XAMPP, questions, comments, and anything related.

CGI and MySQL in LAMPP

Postby Redlet » 11. July 2008 00:13

Hi,

I've written a small CGI application which tries to connect to a MySQL server. The application writes "Success" on the standard output if the connection is succesful or "Failure" if the connection fails.

When I execute the application in a console (/opt/lampp/cgi-bin/test.cgi), "Success" is written. This shows my program and the MySQL server are both OK. When I call the CGI application from a browser (http://myserver/cgi-bin/test.cgi), "Failure" is written. The problem is libmysqlclient.so can't be loaded for a reason I don't understand. The user who runs Apache is allowed to run the application and I added "SetEnv LD_LIBRARY_PATH /opt/lampp/cgi-bin" in /opt/lampp/etc/httpd.conf (/opt/lampp/cgi-bin is the directory where libmysqlclient.so is copied).

Where does the problem stem from ? Any idea ?

Many thanks in advance.
Redlet
 
Posts: 6
Joined: 10. July 2008 23:58

Postby Wiedmann » 11. July 2008 01:03

The problem is libmysqlclient.so can't be loaded

How did you know this?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Redlet » 11. July 2008 07:41

Hi Wiedmann,

Thanks for your interest.

I know the problem is libmysqlclient.so can't be loaded because I added some code in my program to manage exception. Do you know FreePascal ?

Code: Select all
try
  ...
  Connection.Open;
  ...
  WriteLn ('Success' + '<br/>');
except
  on E: Exception do
  begin
    WriteLn ('Failure' + '<br/>');
    WriteLn (E.Message + '<br/>');
  end;
end;


So I get the error message which is :
Can not load MySQL library "libmysqlclient.so". Please check your installation.

When I execute the program from a console, "Success" is written.
Any idea ?

Thanks again for your interest.
Redlet
 
Posts: 6
Joined: 10. July 2008 23:58

Postby Redlet » 15. July 2008 08:28

No idea ? Anybody ?
Redlet
 
Posts: 6
Joined: 10. July 2008 23:58


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 30 guests