CGI script not working due to Error in <TGClient::TGClien

I am trying to run a simple cgi script that reads information from a TTree inside of a TFile. I importing TFile using pyROOT. Once I have read the information, I have a user defined class handle everthing else; I no longer need ROOT at all. However I get the following error from my server object when I attempt to run the cgi script:

Error in <TGClient::TGClient>: can't open display ":0.0", switching to batch mode...
localhost - - [25/Sep/2007 12:09:15] "POST /cgi-bin/ HTTP/1.1" 200 -
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

This python script runs fine when i run it outside of the server.

P.S.: ROOT seems to cause many unexpect problems for me as my code becomes more complex. Is there a way to insulate ROOT from the rest of my code? Is there a simple way to read histograms and TTrees from a *.root without importing ROOT?

Problems related to the use of python, pyroot should be submitted to the pyroot thread, not here.
Reading histograms or Trees from a ROOT file requires ROOT classes.
When running your application from a cgi script you should run ROOT in batch mode (root -b -q script.C)



in order to switch to batch mode, do that as the first statement after “import ROOT”:import ROOT ROOT.gROOT.SetBatch(1)

P.S. If needed, please continue further discussion on the PyROOT forum, thanks!

Your original error meant that you are likely hitting a ssh encryption protection problem. You should run with ssh -Y (see man ssh).