Amnesia Posted August 12, 2010 Posted August 12, 2010 Hi. I have a website at http://www.nixonsoh.co.cc/ Username: nixonsoh I have enabled php server-side parsing in CPanel. I have included the following codes in index.php. <html> <head> <title>PHP Test</title> </head> <body> <?php echo '<p>Hello World</p>'; ?> </body> </html> But there was no output. Page source revealed php tags still intact. What is the problem here? Kindly advise. Thank you. And now it prompts me to download an unknown file: application/x-httpd-php5
Byron Posted August 12, 2010 Posted August 12, 2010 You shouldn't have to enable anything in your cpanel to allow parsing of php pages. Exactly what did you do?
Wizard Posted August 12, 2010 Posted August 12, 2010 Double check the encoding. Open it and resave it with notepad.
Amnesia Posted August 13, 2010 Author Posted August 13, 2010 byron: I added a custom parser in Apache Handler. But I have removed it already so no issues. wizard: what do you mean by the encoding? Right now i have just put in a very simple index.php page to test it out. This is its content. It is basically HTML but i still received the 500 Internal Server Error. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> asdasdasd </body> </html>
Byron Posted August 13, 2010 Posted August 13, 2010 If your not using your .htaccess file for anything, remove it and then refresh your browsers cache and check your page again.
Amnesia Posted August 13, 2010 Author Posted August 13, 2010 If your not using your .htaccess file for anything, remove it and then refresh your browsers cache and check your page again. i have deleted .htaccess and refreshed. but still doesn't work. its weird because i tried a project in .shtml and it worked. then i deleted everything and put in this index.php and it doesn't work anymore.
Byron Posted August 13, 2010 Posted August 13, 2010 Are you sure you've deleted the .htaccess file in your root directory?
Amnesia Posted August 13, 2010 Author Posted August 13, 2010 yes you would be referring to /public_html folder right? .htaccess is deleted already. Refreshed. http://www.nixonsoh.co.cc still getting internal server error.
Byron Posted August 13, 2010 Posted August 13, 2010 Yes that's right. Ok escalating to djbob Domain: nixonsoh.co.cc Username: nixonsoh
Amnesia Posted August 13, 2010 Author Posted August 13, 2010 Right now what im experiencing is that if i rename my page to index.html, the page displays perfectly. But once i rename the SAME file with the SAME codes to index.php, then the internal server error occurs. Guidance would be appreciated. Thank you!
Byron Posted August 13, 2010 Posted August 13, 2010 I'm seeing your index.php ok now except it's throwing php errors because you don't have a footer page or header page. http://nixonsoh.co.cc/index.php UNescalating.
Amnesia Posted August 13, 2010 Author Posted August 13, 2010 I'm seeing your index.php ok now except it's throwing php errors because you don't have a footer page or header page. http://nixonsoh.co.cc/index.php UNescalating. byron thanks for the prompt reply. it is true that i had an index including a header and footer but i have replaced that with the simple index.php with no content at all. so what should be displayed is a blank page. and im still getting the error on firefox. the amazing thing is that once i load it in IE, pressing refresh would lead to the error you described but pressing enter on the address bar would result in the internal server error.
Byron Posted August 13, 2010 Posted August 13, 2010 If you'll create the header and footer page your errors will go away. If you remove ALL of the content from the index.php then yes it should display a blank page. Do a hard refresh if your still seeing the 500 error on another browser.
mrscottm Posted February 18, 2011 Posted February 18, 2011 If you'll create the header and footer page your errors will go away. If you remove ALL of the content from the index.php then yes it should display a blank page. Do a hard refresh if your still seeing the 500 error on another browser. I don't know what you're talking about headers and footers but I'm new to php and this problem is giving me a MAJOR issue. One second, test.php works with <?php phpinfo(); ?> in it. The next second, it does not work but gives Internal Server Error. This happens after clearing cache, it even happens with an empty index.php file. I have no clue what's wrong but I think it's the file encoding since I use ubuntu linux. Please fix this issue! I cannot work with this intermittent problem. As it stands right now, it's just giving Internal Server Error and I can't get it to work again. Now it's working again. No idea what's going on here. It works, then I wait and reload after awhile, it works only about 5% of the time then it just fails with Internal Server Error and I didn't even change anything. Can you please fix it? I really wanted to use this host but with python2.4 and php working only 5% of the time and no shell access, it's not proving to be an enjoyable experience.
Recommended Posts