0
votes

I'm currently hosting an apache24 server on my windows 10 pc. I'm developing a website using php however when I started using php and began to test instead of receiving php or mysql errors I just receive an internal 500 error. I'm using the latest version of php, apache and phpmyadmin.

I've read about something to do with .htaccess but I can't find it anywhere in my server files.

Without this being fixed I cannot continue development :(

I'm not sure what to show in order for help, but please do ask.

UPDATE

After adding error_reporting(E_ALL); ini_set('display_errors', 1); to my code I now get this

Fatal error: Uncaught PDOException: could not find driver in C:\Apache24\htdocs\create.php:24 Stack trace: #0 C:\Apache24\htdocs\create.php(24): PDO->__construct('mysql:host=loca...', 'root', '0612733771Aa') #1 {main} thrown in C:\Apache24\htdocs\create.php on line 24

1
Find your Apache error log first. You'll need to know where that is, and any 500 errors should be detailed there. If the PHP code (as opposed to server configuration) was the cause of the 500 error, you can also make PHP display it. Always when developing and testing code, use error_reporting(E_ALL); ini_set('display_errors', 1); at the top of your code, or set them in the php.ini of the development server. - Michael Berkowski
The http servers error log is what you are after. You cannot develop php in a web environment without monitoring that. - arkascha
I checked the logs which show what I've updated in the original question, I receive this error on the web page and in the error log from apache - Lara Croft
Looks like you haven't installed the PDO library for PHP, or the MySQL PDO driver - gabe3886
I think you might be right, do you know where I can find such things? Thanks in advance - Lara Croft

1 Answers

0
votes

For anyone visiting in the future the solution I found was to remove the commenting from extension_dir in the php.ini on all the pdo related .dlls and then stop apache using the -k stop command, and then starting it again.