apache xampp how to find cause of internal error 500 - javascript

On my PHP website i m getting Internal Server Error 500. I dont know what causing error, even not getting any line number or file name which causing error. I want to know the cause of error so can solve it.
I'm using JavaScript to call PHP function and that function includes other PHP file. And finally JavaScript function gets XML data for further processing
I checked the logs available but not found anything. logs path:
\apche\log
Where error 500 logs are stored?
Any suggestion?

By default errors are written to error.log in $xamppdir\apache\logs. This can be changed in the apache config though.
Directives to look for in the configuration file:
ErrorLog
LogLevel
CustomLog

Related

Why doesn't my request respond with data? Using brackets usually works? [duplicate]

This question already has answers here:
How can I get useful error messages in PHP?
(41 answers)
Closed 5 years ago.
This has never happened before. Usually it displays the error, but now it just gives me a 500 internal server error. Of course before, when it displayed the error, it was different servers. Now I'm on a new server (I have full root, so if I need to configure it somewhere in the php.ini, I can.) Or perhaps its something with Apache?
I've been putting up with it by just transferring the file to my other server and running it there to find the error, but that's become too tedious. Is there a way to fix this?
Check the error_reporting, display_errors and display_startup_errors settings in your php.ini file. They should be set to E_ALL and "On" respectively (though you should not use display_errors on a production server, so disable this and use log_errors instead if/when you deploy it). You can also change these settings (except display_startup_errors) at the very beginning of your script to set them at runtime (though you may not catch all errors this way):
error_reporting(E_ALL);
ini_set('display_errors', 'On');
After that, restart server.
Use php -l <filename> (that's an 'L') from the command line to output the syntax error that could be causing PHP to throw the status 500 error. It'll output something like:
PHP Parse error: syntax error, unexpected '}' in <filename> on line 18
It's worth noting that if your error is due to .htaccess, for example a missing rewrite_module, you'll still see the 500 internal server error.
Be careful to check if
display_errors
or
error_reporting
is active (not a comment) somewhere else in the ini file.
My development server refused to display errors after upgrade to
Kubuntu 16.04 - I had checked php.ini numerous times ... turned out that there was a diplay_errors = off; about 100 lines below my
display_errors = on;
So remember the last one counts!
Try not to go
MAMP > conf > [your PHP version] > php.ini
but
MAMP > bin > php > [your PHP version] > conf > php.ini
and change it there, it worked for me...
Enabling error displaying from PHP code doesn't work out for me. In my case, using NGINX and PHP-FMP, I track the log file using grep. For instance, I know the file name mycode.php causes the error 500, but don't know which line. From the console, I use this:
/var/log/php-fpm# cat www-error.log | grep mycode.php
And I have the output:
[04-Apr-2016 06:58:27] PHP Parse error: syntax error, unexpected ';' in /var/www/html/system/mycode.php on line 1458
This helps me find the line where I have the typo.
If all else fails try moving (i.e. in bash) all files and directories "away" and adding them back one by one.
I just found out that way that my .htaccess file was referencing a non-existant .htpasswd file. (#silly)

Having some trouble with php mail on localhost with XAMPP

I'm trying to work locally so I installed XAMPP and need help resolving an issue while sending mail via a php script on localhost. I've tested everything on a web-facing server and it works fine.
I'm getting the error 'Cannot POST /php/mail.php' from http://localhost:3000/php/mail.php.
I've changed the php.ini and sendmail.ini files and believe they are correctly configured for it to work.
Getting some errors in the DevTools console related to inline scripts but I think they are related to the error page.
Is there somewhere else I can look to debug this error?

Deployment error. [info] Function failed on loading user code. Error message: Code in file index.js can't be loaded

I've been trying to use firebase as a backend for my projects and I'm getting this error and I'm not able to decipher it or find a way to solve it . Below is the debug log for it.
https://docs.google.com/document/d/1IOqbw_WiY75xP1zNKiuhS4vcVRsbGAZApxnHES-fPx4/edit?usp=drivesdk
You can skip to line 216 , that's where errors start and after line 229 it's just the errors repeating themselves in forthcoming functions.
All i did was remove the service account thing from index.js as it was not able to locate it and set my initialize app to apply the default settings for the properties .
Tada it solved my error

Fetch API returns 500 (Internal Server Error) [duplicate]

This question already has answers here:
How can I get useful error messages in PHP?
(41 answers)
Closed 5 years ago.
This has never happened before. Usually it displays the error, but now it just gives me a 500 internal server error. Of course before, when it displayed the error, it was different servers. Now I'm on a new server (I have full root, so if I need to configure it somewhere in the php.ini, I can.) Or perhaps its something with Apache?
I've been putting up with it by just transferring the file to my other server and running it there to find the error, but that's become too tedious. Is there a way to fix this?
Check the error_reporting, display_errors and display_startup_errors settings in your php.ini file. They should be set to E_ALL and "On" respectively (though you should not use display_errors on a production server, so disable this and use log_errors instead if/when you deploy it). You can also change these settings (except display_startup_errors) at the very beginning of your script to set them at runtime (though you may not catch all errors this way):
error_reporting(E_ALL);
ini_set('display_errors', 'On');
After that, restart server.
Use php -l <filename> (that's an 'L') from the command line to output the syntax error that could be causing PHP to throw the status 500 error. It'll output something like:
PHP Parse error: syntax error, unexpected '}' in <filename> on line 18
It's worth noting that if your error is due to .htaccess, for example a missing rewrite_module, you'll still see the 500 internal server error.
Be careful to check if
display_errors
or
error_reporting
is active (not a comment) somewhere else in the ini file.
My development server refused to display errors after upgrade to
Kubuntu 16.04 - I had checked php.ini numerous times ... turned out that there was a diplay_errors = off; about 100 lines below my
display_errors = on;
So remember the last one counts!
Try not to go
MAMP > conf > [your PHP version] > php.ini
but
MAMP > bin > php > [your PHP version] > conf > php.ini
and change it there, it worked for me...
Enabling error displaying from PHP code doesn't work out for me. In my case, using NGINX and PHP-FMP, I track the log file using grep. For instance, I know the file name mycode.php causes the error 500, but don't know which line. From the console, I use this:
/var/log/php-fpm# cat www-error.log | grep mycode.php
And I have the output:
[04-Apr-2016 06:58:27] PHP Parse error: syntax error, unexpected ';' in /var/www/html/system/mycode.php on line 1458
This helps me find the line where I have the typo.
If all else fails try moving (i.e. in bash) all files and directories "away" and adding them back one by one.
I just found out that way that my .htaccess file was referencing a non-existant .htpasswd file. (#silly)

Back4App angular hosting

When Uploading a compiled angular-6 app to back4app and following their Docs
https://www.back4app.com/docs/javascript/angular-template
I always get Error (403 - Forbidden) in the Chrome console although I already added the Keys required to connect to the service in the environment.ts File
Double-check that the files are in the public folder because the 403 error is related to the lack of permission. Another point are the reserved words from Parse, that can affect this, example: /login.

Categories

Resources