500 Internal Server Error for php file not for html

0 votes

There are barely 4-5 static pages on my website. Both index.html and index.php are present. Index.html is operating well. When I switch to index.php, a 500 Internal Server Error message appears. I'm not sure where I went wrong.

It's showing Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

If I use the .htaccess file with empty, It's showing Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

And if I give ../contact-us.php, it's showing correctly. Can someone please help me with this?

Jul 22, 2022 in PHP by narikkadan
• 63,600 points
855 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The problem is that your PHP code has fatal errors but the error displaying is switched off. 

In your PHP file:

ini_set('display_errors', 1);

In .htaccess file:

php_flag display_errors 1

Try the above method to display the error so that you can solve it. I hope this helps you.

answered Jul 23, 2022 by Kithuzzz
• 38,000 points

edited Mar 5

Related Questions In PHP

0 votes
1 answer
0 votes
1 answer

Error:Internal server errordisplay in PHP via htaccess only

Hello @kartik,  Try adding this line .htaccess: php_flag display_startup_errors ...READ MORE

answered Sep 1, 2020 in PHP by Niroj
• 82,840 points
989 views
0 votes
1 answer

Error:PDOException SQLSTATE[HY000] [2020] No such file or directory in php?

Hello, I checked php -i | grep pdo and noticed ...READ MORE

answered Apr 2, 2020 in PHP by Niroj
• 82,840 points
1,594 views
0 votes
1 answer

ERROR: The file 'wp-config.php' already exists

Hello, Try to display the website first on ...READ MORE

answered May 8, 2020 in PHP by Niroj
• 82,840 points
5,606 views
0 votes
1 answer

Invalid argument supplied for foreach() on line 25. Error in my php and mysql

Hello @viven , This should be a simple fix ...READ MORE

answered Aug 4, 2020 in PHP by Niroj
• 82,840 points
4,463 views
0 votes
0 answers

How to open php files through localhost?

I am creating a student management program ...READ MORE

Jun 10, 2022 in PHP by narikkadan
• 63,600 points
1,354 views
0 votes
0 answers
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
10,967 views
0 votes
1 answer

Vertically centering text in a div

Try this code: .smallUnitBox { ...READ MORE

answered Sep 3, 2018 in Blockchain by digger
• 26,740 points
996 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP