php file header
hi guys, i've recently switched from a server that allowed me to create a file without declaring any kind of header info.
however the new web host i have uses cPanel X and the admin said i should place my files into the public_html folder instead of the www folder, i've done that but only html file will load, he said i should add the header info that editors normally insert automatically to indicate that the document type is a php file because simply naming it .php won't work.
any one know where i can find the header code he is referring to?
All I can think that your admin means is that it is only set up to run PHP as CGI. If that is the case and it is a UNIX/Linux server, you may need to add a "shebang" line at the start, but you'll need to know the path to the PHP executable, something like:
This, however, is rather unusual these days on most PHP-enable web servers, where the web server program is configured to run files named with specific suffixes as PHP scripts. Also, if the above is true concerning the need for the "shebang" line, you typically have to put those files in a CGI-specific directory, not just the base public_html directory. So in summary, I'm a bit confused, and a bit leery of using that web host.
echo "Hello, World.";
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
How to Ask Questions the Smart Way
(not affiliated with this site, but well worth reading)
i don't think it's his server, he has a dedicated server and he said some of the files might have been messed up, so he's gonna wipe my area and let me upload my files again. so hopefully that works.
at least i'm on vacation, so i could battle with it tomorrow
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)