php return 500 error but no error log
Scan your source files to find @
.
From php documentation site
Currently the "@" error-control operator prefix will even disable
error reporting for critical errors that will terminate script
execution. Among other things, this means that if you use "@" to
suppress errors from a certain function and either it isn't available
or has been mistyped, the script will die right there with no
indication as to why.
Internal Error 500 Apache, but nothing in the logs?
Please Note: The original poster was not specifically asking about PHP. All the php centric answers make large assumptions not relevant to the actual question.
The default error log as opposed to the scripts error logs usually has the (more) specific error. often it will be permissions denied or even an interpreter that can't be found.
This means the fault almost always lies with your script. e.g you uploaded a perl script but didnt give it execute permissions? or perhaps it was corrupted in a linux environment if you write the script in windows and then upload it to the server without the line endings being converted you will get this error.
in perl if you forget
print "content-type: text/html\r\n\r\n";
you will get this error
There are many reasons for it. so please first check your error log and then provide some more information.
The default error log is often in /var/log/httpd/error_log
or /var/log/apache2/error.log
.
The reason you look at the default error logs (as indicated above) is because errors don't always get posted into the custom error log as defined in the virtual host.
Assumes linux and not necessarily perl
Laravel 500 error no logs
Add a dd($exception->getMessage());
to the exception handler class right before line 37. Run the request and check the response.
If that doesn't avail anything, verify the request is hitting the webserver by checking access and error logs. Check system logs also using dmesg
and similar.
Since you mention Docker, if you're using nginx, be sure your site configuration is not being overwritten when running docker-compose up
.
php return 500 error but no error log
Scan your source files to find @
.
From php documentation site
Currently the "@" error-control operator prefix will even disable
error reporting for critical errors that will terminate script
execution. Among other things, this means that if you use "@" to
suppress errors from a certain function and either it isn't available
or has been mistyped, the script will die right there with no
indication as to why.
500 Internal Server Error - No Error Log
As it turns out there was a problem with the database. Sorry to those who spent time trying to help. The guy running the database found the problem. Thank for trying though.
How can I make PHP display the error instead of giving me 500 Internal Server Error
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.
Where exactly can I check error logs for 500 error?
In Linux Systems
/var/log/[SERVER NAME]/php_errors.log & errors.log
[SERVER NAME] is apache2 - if you are using apache or lampp - when you are using lampp
In Windows System
[SERVER SOURCE ROOT]/logs.
(P.S - This Paths are default configured paths check php.conf)
Related Topics
Create Blog Post Links Similar to a Folder Structure
How to Pass Arguments to My Function Through Add_Action
Proper Url Forming with a Query String and an Anchor Hashtag
Sqlstate[Hy000] [1698] Access Denied for User 'Root'@'Localhost'
How to Store an Array into MySQL
If Singletons Are Bad Then Why Is a Service Container Good
How to Get a PHP Class Constructor to Call Its Parent's Parent's Constructor
Access to Laravel 5 App Locally from an External Device
Loop Code for Each File in a Directory
How to Specify Composer Install Path
How to Add a Line Break Within Echo in PHP
PHP APIs for Hotmail, Gmail and Yahoo
Using Usort in PHP with a Class Private Function
Efficiently Pick N Random Elements from PHP Array (Without Shuffle)