I have a simple database with a few tables and I want to write some php script to fetch that data to my app. I deploy it on a shared host. Everything works fine, until today, I cant fetch data anymore, it always return HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. After that, I write a test.php like this
<?php>
echo 'bla bla bla';
<?>
And it dont run too. I mean I see a blank page. After that, I try a test.html like this:
<html>
<head>
<title>PHP Test Page</title>
</head>
<body>
PHP test page.
<?php
echo phpinfo();
?>
</body>
</html>
Only the "Php test page." appears in screen. I try byethost.com and oni.cc, the same problem appears. I dont see any .htaccess in htdocs folder. Please give some guidance. Thank you in advance for your time and assisstance.
I would check things like this:
Actually, in my experience, 500th error is mostly caused by endless loops or/and bad server config ( usually apache's .htaccess )
Try this:
<?php echo 'bla bla bla'; ?>
Ok so you can run the phpinfo(); script, but some of your pages don't work Did you try to debug?
try to set error_reporting to on, put this on top of the file before any includes:
<?php
ini_set('display_errors', 1);
ini_set('display_errors', E_ALL);
error_reporting(E_ALL);
?>
check for tag errors, like I said above <?php echo 'bla bla bla'; ?>
check your .htaccess
file, maybe you did something worng there
check your control panel for any errors. any shared hosting should provide an control panel with process information. Maybe it's overloaded.