InMotion Hosting Support Center

Can I run a PHP file from the cgi-bin?

Category: How To

2012-02-09 4:35 pm EST

Hits: 4,053
How do I point to my cgi library from HTML pages? For example, I have this code:

var client = new XMLHttpRequest();"POST", "/SCOMSTO/logger.php", true);

and it works on another server because there is a mapping directive that maps /SCOMSTO/* to /u/scomsto/cgi-bin/*

Similarly, in another HTML page I have:

You must login before you can ask a follow up question.

You must login before you can submit an answer.

Best answer chosen by User


Tim S.
9,967 Points
2012-02-09 4:43 pm EST
Hi SteveC,

Thanks for posting your question. I'm more than happy to assist you today. If you are on a VPS or Dedicated hosting plan you can contact our support department to have a symlink set up.

If you are on a shared hosting package, you'll need to store the cgi scripts in the cgi-bin folder in the public_html folder. Then you'll need to update your path in your code to reflect the path to the cgi-bin. If the HTML page calling the script is in the public_html folder, the path would be:

var client = new XMLHttpRequest();"POST", "/cgi-bin/logger.php", true);

I hope this helps! If you need further assistance please feel free to contact us.


Tim S

You must login before you can post a comment about this answer.

Like this Question?

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!