Jump to content

accessing MySQL using .cgi file


Recommended Posts

My host has recently upgraded to

 

cPanel 11.25.0-S43473 - WHM 11.25.0 - X 3.9

REDHAT Enterprise 5.2 x86_64 standard

 

and doing so has caused my suspended page not to work like before.

 

i have a contact us page that stored the messages in a mysql database as well as email them to my email address.

 

now this does not work and i have been told that PHP does not work in a .cgi file.

 

how do i access the MySQL database using .cgi files ?

Link to comment
Share on other sites

strange as my host says that PHP will not run in the cgi file!!

 

ok i have tried to add just basic php like so...

 

 

<?
echo("hello world");
?>

 

 

i would expect

hello world

 

to show but i get

 

<?
echo("hello world");
?>

 

at the top of my page or where ever i place this php code.  so it seems that PHP is not being executed as PHP

Link to comment
Share on other sites

mmm  i did try that before but tried again and still got the same result, and on viewing the source code the php code is visable.

 

<?php echo("hello"); ?>

 

would there be a setting on the setver that prevents the php from being executed in cgi files ?

Link to comment
Share on other sites

cgi files usually require a shebang line at the top to tell the server what program needs to execute the script. Something like....

 

#!/usr/bin/php

 

However, if your host is saying that php cgi isn't supported I would tend to believe them.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.