IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

EDI Delphi Discussion :

[Kylix] [CGI][IBX][INTERBASE]Erreur 500, Apache et CGI


Sujet :

EDI Delphi

  1. #1
    Membre régulier

    Homme Profil pro
    Développeur Java
    Inscrit en
    Mars 2002
    Messages
    65
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 51
    Localisation : France, Indre et Loire (Centre)

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Mars 2002
    Messages : 65
    Points : 99
    Points
    99
    Par défaut [RESOLU][CGI][IBX][INTERBASE]Erreur 500, Apache et CGI
    Bonjour,

    J'ai un CGI qui se connecte à une base Interbase via IBX (derniere version pour kylix).

    En local (mode debbugage) pas de probleme, mais des que je le met dans le repertoire cgi-bin de mon serveur apache, il ne veux plus l'executer et me renvoi une erreur 500...

    Le même CGI (compilé sous D6 Ent.) executer sous un serveur Apache fonctionnant sous Win2K ne pose aucun probleme et s'execute correctement...

    La base est acceder via TCP

    Avez vous une idée


  2. #2
    Membre régulier

    Homme Profil pro
    Développeur Java
    Inscrit en
    Mars 2002
    Messages
    65
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 51
    Localisation : France, Indre et Loire (Centre)

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Mars 2002
    Messages : 65
    Points : 99
    Points
    99
    Par défaut
    Bonjour,

    Le probleme est que TIBDatabase utilise un timer via un objet TTimer...
    ... qui se trouve dans la librairie QExtCtrls qui utilise QT afin d'utiliser le timer de la libraire QT, qui sont des Widget !!!!

    Voila pourquoi Apache plante, la seule solution semble être de recréer un timer via un thread !!!!

    Mais y'a t'il pas une autre solution ?...

    Cordialement

  3. #3
    RDM
    RDM est déconnecté
    Membre émérite

    Profil pro
    Inscrit en
    Mars 2002
    Messages
    1 424
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2002
    Messages : 1 424
    Points : 2 927
    Points
    2 927
    Par défaut
    quelle version de Kylix ?
    Il faut aussi faire un
    SetEnv LD_LIBRARY_PATH "$home/kylix?/bin"
    pour que le CGI fonctionne correctement
    RDM
    Tout Est Relatif
    Rubrique XMLRAD: http://xmlrad.developpez.com
    FAQ XMLRAD: http://xmlrad.developpez.com/faq/

  4. #4
    Membre régulier

    Homme Profil pro
    Développeur Java
    Inscrit en
    Mars 2002
    Messages
    65
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 51
    Localisation : France, Indre et Loire (Centre)

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Mars 2002
    Messages : 65
    Points : 99
    Points
    99
    Par défaut
    Bonjour,

    Merci pour ta reponse, mais voila la suite du probleme:

    Mais le probleme, c'est que le serveur Apache n'est accessible que par telnet, et n'a pas Kylix d'installé...

    Dans ce cas, quelle librairie installer dans le repertoire du CGI ?

    Cordialement

  5. #5
    RDM
    RDM est déconnecté
    Membre émérite

    Profil pro
    Inscrit en
    Mars 2002
    Messages
    1 424
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2002
    Messages : 1 424
    Points : 2 927
    Points
    2 927
    Par défaut
    sit ut utilises des unité commencant par Q (QGraphics, QForms, QControls, etc.) tu dois livré libqtintf*.so et selon la distrib le libqt*.so qui se trouve dans le répertoire de kylix.

    http://esibert.developpez.com/kylix/deploy/
    RDM
    Tout Est Relatif
    Rubrique XMLRAD: http://xmlrad.developpez.com
    FAQ XMLRAD: http://xmlrad.developpez.com/faq/

  6. #6
    Membre régulier

    Homme Profil pro
    Développeur Java
    Inscrit en
    Mars 2002
    Messages
    65
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 51
    Localisation : France, Indre et Loire (Centre)

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Mars 2002
    Messages : 65
    Points : 99
    Points
    99
    Par défaut
    Bonjour,

    Tout d'abord, merci pour tes precieux conseils (et ton tutorial)...

    Mais le probleme, c'est qu'Apache et QT font assez mauvais ménage. Donc mon CGI avec la version actuelle d'IBX ne fonctionne pas (provoque une erreur d'execution du serveur).

    Cordialement

  7. #7
    Membre régulier

    Homme Profil pro
    Développeur Java
    Inscrit en
    Mars 2002
    Messages
    65
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 51
    Localisation : France, Indre et Loire (Centre)

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Mars 2002
    Messages : 65
    Points : 99
    Points
    99
    Par défaut
    Bonjour...

    J'ai trouvé la solution à mon probleme...

    J'ai recréé un timer pour IBDatabase.pas. Qui est en réalité un composant de base utilisant un jeux de thread, mesure fait, je suis precis à 5 ms...

    Voici le code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
     
    type
      TOdTimer = class;
      TOdInThread = class;
      TOdInExecEvent = class;
     
      TOdTimer = class(TComponent)
      private
        ExecuteTimerEvent: boolean;
        FEnabled: Boolean;
        FInterval: Cardinal;
        FOnTimer: TNotifyEvent;
        FInThread: TOdInThread;
        procedure SetEnabled(const Value: Boolean);
        procedure SetInterval(const Value: Cardinal);
        procedure SetOnTimer(const Value: TNotifyEvent);
        function GetInThread: TOdInThread;
      protected
        property InThread: TOdInThread read GetInThread;
     
        procedure Timer; dynamic;
      public
        constructor Create(AOwner: TComponent); override;
        destructor Destroy; override;
      published
        property Enabled: Boolean read FEnabled write SetEnabled default True;
        property Interval: Cardinal read FInterval write SetInterval default 1000;
        property OnTimer: TNotifyEvent read FOnTimer write SetOnTimer;
      end;
     
      TOdInThread = class(TThread)
      private
        FOwner: TOdTimer;
        FInExecThread: TOdInExecEvent;
        FMSInterval: TDateTime;
        procedure SetOwner(const Value: TOdTimer);
        procedure SetInExecThread(const Value: TOdInExecEvent);
        procedure SetMSInterval(const Value: TDateTime);
      protected
        property InExecThread: TOdInExecEvent read FInExecThread write SetInExecThread;
     
        procedure Execute; override;
      public
        property Owner: TOdTimer read FOwner write SetOwner;
        property MSInterval: TDateTime read FMSInterval write SetMSInterval;
     
        constructor Create(AOwner: TOdTimer); reintroduce;
        destructor Destroy; override;
      end;
     
      TOdInExecEvent = class(TThread)
      private
        FOwner: TOdInThread;
        FInAction: boolean;
        procedure SetOwner(const Value: TOdInThread);
        procedure SetInAction(const Value: boolean);
      protected
        procedure Execute; override;
      public
        property Owner: TOdInThread read FOwner write SetOwner;
        property InAction: boolean read FInAction write SetInAction;
     
        constructor Create(AOwner: TOdInThread); reintroduce;
        destructor Destroy; override;
      end;
     
    implementation
     
    { TOdTimer }
     
    constructor TOdTimer.Create(AOwner: TComponent);
    begin
      inherited;
      Interval := 1000;
      Enabled := false;
    end;
     
    destructor TOdTimer.Destroy;
    begin
      if not InThread.Terminated then
        InThread.Terminate;
      InThread.Free;
      inherited;
    end;
     
    function TOdTimer.GetInThread: TOdInThread;
    begin
      if not assigned(FInThread) then
        begin
          FInThread := TOdInThread.Create(Self);
        end;
      Result := FInThread;
    end;
     
    procedure TOdTimer.SetEnabled(const Value: Boolean);
    begin
      if Enabled<>Value then
        begin
          FEnabled := Value;
          if Enabled then
            InThread.Resume else
              InThread.Suspend;
        end;
    end;
     
    procedure TOdTimer.SetInterval(const Value: Cardinal);
    var
      ms,
      s,
      m,
      h: integer;
    begin
      if Interval <> Value then
        begin
          FInterval := Value;
          ms := Interval mod 1000;
          s := Interval div 1000;
          m := s div 60;
          s := s mod 60;
          h := m div 60;
          m := m mod 60;
          InThread.MSInterval := EncodeTime(h,m,s,ms);
        end;
    end;
     
    procedure TOdTimer.SetOnTimer(const Value: TNotifyEvent);
    begin
      FOnTimer := Value;
    end;
     
    procedure TOdTimer.Timer;
    begin
      ExecuteTimerEvent := true;
      if assigned(FOnTimer) then
        FOnTimer(Self);
      ExecuteTimerEvent := false;
    end;
     
    { TOdInThread }
     
    constructor TOdInThread.Create(AOwner: TOdTimer);
    begin
      if AOwner = nil then
        raise Exception.Create('Owner must be not null');
      inherited Create(true);
      Owner := AOwner;
      InExecThread := TOdInExecEvent.Create(Self);
      FreeOnTerminate := false;
    end;
     
    destructor TOdInThread.Destroy;
    begin
      if not InExecThread.Terminated then
        InExecThread.Terminate;
      InExecThread.Free;
      Owner := nil;
      inherited;
    end;
     
    procedure TOdInThread.Execute;
    var
      ThreadTime: TDateTime;
    begin
      ThreadTime := Now;
      while not Terminated do
        begin
          Sleep(5);
          if ((Now - ThreadTime) > (MSInterval)) and (not InExecThread.InAction) then
            begin
              InExecThread.Resume;
              ThreadTime := now;
            end;
        end;
    end;
     
    procedure TOdInThread.SetInExecThread(const Value: TOdInExecEvent);
    begin
      FInExecThread := Value;
    end;
     
    procedure TOdInThread.SetMSInterval(const Value: TDateTime);
    begin
      FMSInterval := Value;
    end;
     
    procedure TOdInThread.SetOwner(const Value: TOdTimer);
    begin
      FOwner := Value;
    end;
     
    { TOdInExecEvent }
     
    constructor TOdInExecEvent.Create(AOwner: TOdInThread);
    begin
      inherited Create(true);
      Owner := AOwner;
      FreeOnTerminate := false;
      InAction := False;
    end;
     
    destructor TOdInExecEvent.Destroy;
    begin
     
      inherited;
    end;
     
    procedure TOdInExecEvent.Execute;
    begin
      while not Terminated do
        begin
          InAction := true;
          if assigned(Owner.Owner.OnTimer) then
            Owner.Owner.OnTimer(Owner.Owner);
          InAction := false;
          Suspend;
        end;
    end;
     
    procedure TOdInExecEvent.SetInAction(const Value: boolean);
    begin
      FInAction := Value;
    end;
     
    procedure TOdInExecEvent.SetOwner(const Value: TOdInThread);
    begin
      FOwner := Value;
    end;
    Cordialement

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Erreur 500 sur apache
    Par ksaidi31 dans le forum Apache
    Réponses: 6
    Dernier message: 19/03/2009, 10h33
  2. Erreur 500 avec CGI
    Par Neuromancien2 dans le forum Apache
    Réponses: 2
    Dernier message: 09/08/2008, 20h40
  3. apache - erreur 500
    Par roger12 dans le forum Web
    Réponses: 2
    Dernier message: 15/01/2007, 11h19
  4. [Apache] Erreur dans mes scripts CGI
    Par GLDavid dans le forum Apache
    Réponses: 2
    Dernier message: 28/08/2004, 06h14
  5. [web] [CGI][Easyphp] erreur 500
    Par nico72 dans le forum Web
    Réponses: 11
    Dernier message: 29/07/2004, 20h08

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo