in reply to DBD::SQLite - Standalone on webserver via FTP?

As long as they've got a compiler, it should be possible. First, write a CGI script that will do a qx// on whatever you send it and send you back the results (and password protect it!). Make sure you can see STDERR too.

Now do a few tests to make sure it's running things as your UID (most CGI servers are set to suidexec your scripts) and that you can view your home directory. Now upload the DBD-SQLite tar-ball. Then issue the magic command:

cd ~ && tar zxvf DBD-SQLite*gz && cd DBD-SQLite* && perl Makefile.P +L PREFIX=~ && make install;

If all goes well you should have a compiled copy of DBD::SQLite in ~/lib.

-sam

Replies are listed 'Best First'.
Re: Re: DBD::SQLite - Standalone on webserver via FTP?
by webfiend (Vicar) on Apr 14, 2004 at 17:49 UTC

    Good thought overall, and very clever suggestion. Just be be careful that this isn't considered abuse by your host. There is a chance that the host wouldn't care for sneaky compiler running when they've got ssh blocked.

    Of course, if they suck that bad, there are better hosts available for cheap :-)

      Why don't you just contact your ISP and ask if they'd install it. It isn't such a crazy request. Might take a week, but as you said, you're writing your code with the right hooks anyway...
Re: Re: DBD::SQLite - Standalone on webserver via FTP?
by simonm (Vicar) on Apr 14, 2004 at 18:35 UTC
    As long as they've got a compiler, it should be possible. First, write a CGI script that will do a qx// on whatever you send it and send you back the results ... Now upload the DBD-SQLite tar-ball. Then issue the magic command ...

    Better yet, just have that CGI script use CPAN. Here's a (completely untested) outline of a "cpan_installer.cgi" script:

    #!perl use CGI qw/:standard/; use CPAN; print header(); if ( my $module = param('module') ) { print start_html("Installing $module"), h1("Installing $module"); $ENV{PREFIX} = '~'; eval { CPAN::Shell->expand('Module',$module)->install }; if ( $@ ) { print "<font color=red>Failure: $@</font>"; } } else { print start_html("CPAN Installer Tool"), h1("CPAN Installer Tool"); print start_form(), textfield('module', ""), submit('install', "Click to Install"), end_form(); } print end_html();

    Properly fitted out with some logic to detect common configuration problems and extra form controls to allow futzing with the make process, this might serve as a useful resource... I notice a routine stream of postings along the lines of "I only have FTP and CGI access on my web server account, and want to install X." It'd be nice if we could reply with something like "Just upload this script and it will either guide you through the process, or explain why it can't be done on your server."

    Update: On second thought, this is more complicated than the above suggests; for example, we may need to deal with configuring CPAN for the first time, which this script doesn't do... But I still think that a suitably enhanced "cpan.cgi" script could be useful to many.