|
Can I run a PHP file from the cgi-bin?
Category: How To
|
|
Question Asked by SteveC
Can I run a PHP file from the cgi-bin?
Resolved Question
How do I point to my cgi library from HTML pages? For example, I have this code:
var client = new XMLHttpRequest();
client.open("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:
var client = new XMLHttpRequest();
client.open("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:
- Asked 2012-02-09 16:35
- Hits: 2193
- Closed on: 2012-02-09 16:23
Best Answer Chosen by SteveC
Vote
0
0
0
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:
I hope this helps! If you need further assistance please feel free to contact us.
Thanks!
Tim S
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();
client.open("POST", "/cgi-bin/logger.php", true);
I hope this helps! If you need further assistance please feel free to contact us.
Thanks!
Tim S
2012-02-09 16:43
No other Answers Submitted
Rating:
Please log in to rate this question.
Like this Question?
Comments
Need more Help?
| Search
|
Current Customers
|
||||||||
Need more How To help? Try browsing the standard How To category page in our Knowledge Base. |
Not a Customer? |

Support Center Login
Have a question?
Comments
My apologies, you cannot run PHP scripts form the cgi-bin. I copied your script over to your public_html folder and ran it from a web browser to see if it would execute and it appears to create "thelog" file as it should.
You can run the script from any folder in the public_html folder other than the cgi-bin and it should be fine.
If you need further assistance please feel free to contact us.
Thanks!
Tim S
Thanks for the rapid response. I gave it a try and nothing is happening. I see my CGI in public_html/cgi-bin:
logger.php with permissions 744, but it doesn't seem to be working. I judge that by the fact that the file that is to be created, 'thelog', is not visible in either the cgi-bin nor the public_html directories.