[ensembl-dev] Problem with using ensembl API when called via the web

Natascha May natascha at tll.org.sg
Wed Oct 19 05:44:36 BST 2011


Hello everyone,

I am new to using the ensembl perl API (version 63). I would really 
appreciate some help for a problem I'm having with my perl script.

The perl script basically connects to the DB and uses the slice method 
to retrieve some information. If I run this perl script
from my terminal, it works fine, and I am able to get results from 
ensembl. However, if I call this perl script via a php script
(because I am trying to develop a web based tool), the MySQL connection 
fails.

Error message in httpd/error_log:

    DBI connect('host=ensembldb.ensembl.org;port=5306','anonymous',...)
    failed: Can't connect to MySQL server on
    'ensembldb.ensembl.org' (13) at
    /var/www/cgi-bin/tll_blat/ensembl-src/ensembl/modules/Bio/EnsEMBL/Registry.pm
    line 1452
    Can't call method "selectall_arrayref" on an undefined value at
    /var/www/cgi-bin/tll_blat/ensembl-src/ensembl/modules/Bio/EnsEMBL/Registry.pm
    line 1455.


I have explicitly set the location of the ensembl and perl modules at 
the top of my perl script as follows:

    use warnings;

    use lib '/var/www/cgi-bin/tll_blat/ensembl-src/bioperl-1.2.3';
    use lib '/var/www/cgi-bin/tll_blat/ensembl-src/ensembl/modules';

    use Bio::EnsEMBL::Registry;

    $registry = 'Bio::EnsEMBL::Registry';
    $slice='Bio::EnsEMBL::Slice';
    $gene='Bio::EnsEMBL::Gene';

    $registry->load_registry_from_db(-host => 'ensembldb.ensembl.org',
    -user => 'anonymous');

All this works when I run it from command line, but not via the web.
Where could I be going wrong...?

Thank you so much!

~ Natascha

Information in this email is confidential and may also be privileged. It is intended solely for the person to whom it is addressed. If you are not the
intended recipient, please notify the sender, and please delete the message and any other record of it from your system immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20111019/c33e1ba2/attachment.html>


More information about the Dev mailing list