The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Running CGI Scripts Inside CPanel?

Discussion in 'General Discussion' started by LazulaWeb.com, Oct 16, 2002.

  1. LazulaWeb.com

    LazulaWeb.com Member

    Joined:
    Oct 16, 2002
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hello, I am hopeing someone here can help me. I am trying to create my own CPanel Theme. I would like to run a CGI script so I can addin some of my custom billing stuff for each client. I cannot get the cgi script to work. I Have

    www.xxxxx.com:2082/frontend/MYTHEME/index.cgi

    I know that CPanel does not run on apache so is this possible? I have saw someone run a php script in these directories so thats why im thinking it is possible.

    Please help,

    Thanks
    Ryan
     
  2. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    Not really CGI I think, but you can run perl scripts this way:
    &perl /path/to/perl/script&
    Make sure the script exits with 1 for its output to be displayed.
     
  3. LazulaWeb.com

    LazulaWeb.com Member

    Joined:
    Oct 16, 2002
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    that halfway works!

    Hello, Thanks for the help. That will work if I just use a basic cgi script. When I addin the code to connect to my mySQL database i get a LW/SIMPLE.pm error? Has anyone successfully integrated a cgi/perl script into cPanel before?

    Thanks,
    Ryan
     
  4. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    Sorry, I answered too fast. You can certainly run CGI and PHP scripts from inside Cpanel. Create a directory in /usr/local/cpanel/base/3rdparty for your program and store your files there. Chmod the directory and all CGI scripts 0755. You can run it from a user's cpanel this way:

    &a href=&/3rdparty/yourdirectory/index.cgi&&Billing&/a&

    I don't know what could be wrong with LW/SIMPLE.pm, I use DBI to connect to the MySQL database and it works OK.
     
  5. LazulaWeb.com

    LazulaWeb.com Member

    Joined:
    Oct 16, 2002
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Not Working

    When I chmoded my theme directory and script. I did exactly what you showed told me and for some reason when I click on the link it just displays the code of the cgi script. Is there something I need to do to make it work on my server?

    Please help,
    Thanks,
    Ryan
     
  6. sav

    sav Member

    Joined:
    Oct 15, 2002
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    [quote:6623d9e8c1][i:6623d9e8c1]Originally posted by LazulaWeb.com[/i:6623d9e8c1]
    When I chmoded my theme directory and script. I did exactly what you showed told me and for some reason when I click on the link it just displays the code of the cgi script. Is there something I need to do to make it work on my server?[/quote:6623d9e8c1]

    Try [b:6623d9e8c1]chmod 755 yourscript.cgi[/b:6623d9e8c1] :p
     
Loading...

Share This Page