Lunarpages Web Hosting Forum

Author Topic: Simple CGI Question  (Read 5271 times)

Offline sm535

  • Trekkie
  • **
  • Posts: 17
Simple CGI Question
« on: July 29, 2010, 06:15:55 AM »

This must be a simple question for gurus out there:

I am trying to build a cgi script in perl that calls a user application located currently at /opt/some/path/app.

system("/opt/some/path/app -option1 -option2 ...");

Is this allowed since /opt/some/path is not under the web root /public_html/.... directory? Or do I need to install the application under  the cgi-bin path? Will soft/hard link/.htaccess change work to point to /opt/some/path from under cgi-bin?

« Last Edit: July 29, 2010, 10:56:14 AM by sm535 »

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6429
Re: Simple CGI Question
« Reply #1 on: July 30, 2010, 10:55:26 AM »
If this is on a Lunarpages shared server, you probably won't be allowed to access /opt. If it's on a VPS or dedicated server, or home PC LAMPP server, it might be allowed. Check if there is any kind of "open_basedir" restriction in effect for your server configuration. Perl itself shouldn't have any trouble running something on an absolute path (does not have to be under public_html/). I wouldn't think you'd need to move (or fake a move with a link) the application out of /opt, unless you can't get around the open_basedir restriction (and if you could install your application into /opt in the first place, I would assume that you have the power to change the server configuration).
Visit My Site

E-mail Me
-= From the ashes shall rise a sooty tern =-