Laravel 500 Internal Server Error after Composer Update - php

I wanted to create a new blog so I tried, then was greeted with this message:
This development build of composer is over 60 days old. It is
recommended to update it by running "/usr/local/bin/composer
self-update" to get the latest version.
So I did, and it seemed fine, then I created the blog and I got this error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, you#example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Then I went to the directory of the blog and executed this command
chmod 755 -R storage
So as to allow composer to log my errors, the command seemed to be executed properly, I refreshed my blog in the browser and still, 500 error, so I check the logs, and still nothing, it is still not logging anything.
Then I check my previous projects and they had a 500 internal server error too.
I have probably tried solutions from 20+ different forums and threads and nothing will work. I have changed my .htaccess file to every variation of every correct answer I could fined (backup the original) but it is obviously not to do with the .htaccess because my previous projects worked and now they don't.
If anyone knows why this may be happening or if there's something else I should try, please help me, thank you.

Related

MAMP Pro showing server internal 500 error on PHP throw new Exception

Just for the record, here's the error I'm getting (don't stop reading there):
Oops! An Error Occurred The server returned a "500 Internal Server Error".
Something is broken. Please let us know what you were doing when this error occurred.
We will fix it as soon as possible. Sorry for any inconvenience caused.
Before you jump to the usual conclusions, let me tell you that I traced the error to; a line like:
throw new \Exception("Some value not recognized: $someVar");
Normally Exceptions work fine; I can't tell why this one's so weird.
$someVar isn't storing anything weird, just a string like "Hi, I am a string". The Exception running actually makes sense with the input I tested. What I'm unable to figure out is why the 500 error is happening, and why there's no logs for it, and why anything I try doesn't solve the problem or give me any clue what to do next.
I already tried enabling PHP errors, across many files, even up to the line right before the Exception line:
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
MAMP's Apache logs and PHP logs show nothing for it, just earlier unrelated stuff.
MAMP appears to not have its own log files, so I can't see what's actually failing.
For some reason, something is triggering the 500 error, and all I'm seeing is another brick in the wall.
My MAMP Pro (paid) version is 6.6.2, my macOS is Monterey, Apache 2.4, PHP 7.4 (sorry, we're trying to upgrade), and everything's been working fine until today.

php opencart website 500 status

after 2 years, Suddenly if I try to visit an https://www.xxxx.com website built with opencart I get 500 status error, however, when I load the website dashboard and I logon, then I go back to https://www.xxxx.com and it works, I DO NOT get the 500 error status. I have tried the steps above on different clients (chrome) and I get 500 status unless I logon to the dashboard. I checked mysql and apache all running ok, I restarted the digital ocean server (ubuntu 14.04) without luck.I found the following log in the apache error
call to a member function getModule() on a non-object in /var/www/html/catalog/controller/common/footer_modules.php on line 23
why suddenly I am getting this error? code not changed at all. I do not know how to troubleshoot it. I appreciate some detailed steps.
This is resolved by going to dashboard's Settings --> Store -- > maintenance and unchecking maintenance to No. Maintenance tickbox was set to Yes. Somehow the error does not indicate at all the cause. I set it to No and the error disappeared. I am investigating now whether someone hacked the server or someone had access to the server.

Drupal WSOD Error 500

I've researched about settings.php, index.php, and .htaccess but to no avail.
Basically I want to back up my production site to my acquia dev desktop 2 site. Here I made a back up of the folder and database.
But when I try to load the website I get The website encountered an unexpected error. Please try again later. and in the console log I get:
GET https://omgyay.dd:8443/favicon.ico 404 (Not Found) favicon.ico:1
GET https://omgyay.dd:8443/ 500 (500 Service unavailable (with message)) omgyay.dd/:1
Navigated to https://omgyay.dd:8443
and inside the apache log I get PDOException: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.'
Any information is helpful. Mostly on how to print out the specific error message. Again, this error message is after I migrated my code over locally and before I can see any webpages once installed.
In my case php7.0-crul missing.
sudo apt-get install php7.0-crul
service apache2 restart
solved the problem.
Figured out my question. Basically The GET error had nothing to do with the error itself, but the Apache log was very informative.
You can find the log by clicking on Acquia Dev Desktop on the top left > preferences > Logs > Apache errors. Then it opens up a .txt and scroll all the way to the bottom. It told me I had no access to the database.
I had the wrong username and password to my database in Settings.php and changed them.

Swiftmailer crashes without php error

I have a web app that allows the user to upload a pdf and it will then email it to us via swiftmailer. With some pdfs, the process fails.
I can verify that it crashes the php script, yet returns no php error. There's a 500 error from the server, but normally if there's a 500 error, php has a log of what the error was.
I have also verified that it crashes at the
$mailer->send($message);
line
Oddly, only some pdfs crash it, and those same pdfs work fine on the development server with identical code.
What could be causing php to crash without an error message?
After running several tests, I found that error logging was happening some of the time, but not others. I didn't figure out why that was so, however, I tried renaming the php-errors.log file so php would start with a new, fresh log file, and now errors are getting logged properly. I don't know why that worked, but I'll take it.
FYI, I've run into two things that can cause a PHP crash without an error message:
Script timeouts - A timeout may prevent an error message from being returned; in my particular case the script was waiting for an SMTP response when the timeout happened, which may have been why I didn't get a timeout message. Try changing your max_execution_time value in php.ini to 300 (5 minutes) and see if you can get an actual error message.
Folder permissions - I've encountered a case where insufficient folder permissions resulted in the script just halting without providing an error.
In the case of 2, I wrapped a try/catch clause around the line that was causing the halt, and I finally got an Exception to show up explaining about the permissions problem. That may be worth trying as a general response to silent crashes.

The server encountered an internal error or misconfiguration and was unable to complete your request

I installed one product. I got error like this. I dont know how to resolve this. I checked Php.ini file, .htacess file and file permission too. All are correct. Anybody tell the solution.
Error Message :
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webadmin#xxxxxx.xx and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
The reason why the 404 error showed was because it was trying to write the error to a log, which you do not have enabled:
First thing to do is if you can get in the admin section of your site, make sure you have error reporting set to on:
Here is how to enable error reporting:
system_configuration_ADVANCED_Developer (system>configuration>ADVANCED>Developer)
When you open that tab you'll see a section called "log settings" choose the following:
-enabled to yes
- System Log File Name: system.log (or you can replace the system with another word like magensys.log)
-Exceptions Log File Name: exception.log
Now both these log files can be found in /var_log (www.domainhere.com/var/log or if it's a local installation magentofolder/var/local)
Try reloading the page where this error occurs and if it does occur again, then open your error log to see the error.
Most of the time it's due to extensions not agreeing with what you are trying to accomplish.
Option 2) Go to app_etc_local (app/etc/local) and delete the local.xml then reload your site and reinstall magento, this will not delete your site just reload your basic settings so you can everything back to normal.
If you could be a little more clear to what kind of product you were installing, where you were installing, etc... that would help pinpoint the error.
You need to check your php error log, if you don't know where it is you can do the following from your terminal:
$ -> `php -i | fgrep -i error`
You should see an entry for error_log. Tail that file and refresh the page, it should display the error.
Maybe this article
will help you. Try to use
<?php
# test.php
error_reporting(E_ALL);
ini_set('display_errors','On');
ini_set('error_log','my_file.log');
foreach(1 as $i);
ini_set('error_log','');
foreach(1 as $i);
ini_set('error_log','/dev/null'); #linux
foreach(1 as $i);
?>
I was facing this error because of wrong entries in httaccs file. Plz check your http access file

Categories