When my notify code runs when it is supposed to, I am getting the error Swift_TransportException in AbstractSmtpTransport.php line 383:
Expected response code 250 but got code "", with message "" on my Laravel 5.3 production site. When I look at the full stack trace, it seems to be caching old-incorrect login credentials. I have checked and double checked the updated 'config/mail.php' file and the .env file. The stack trace is showing "Swift_Transport_Esmtp_Auth_LoginAuthenticator->authenticate(object(Swift_SmtpTransport" with totally outdated credentials that are different from the afore mentioned updated files. I have run "sudo systemctl restart nginx" and "php artisan cache:clear" with no change. Can someone tell me how to address this error message more effectively? Is there a different file I need to update? or setting? Everything works fine on my dev machine using mailtrap.
See Laravel 5.3 > Configuration Caching
You should typically run the php artisan config:cache command as part of your production deployment routine.
Run php artisan config:cache and restart your server. This will scrap loaded/cached configuration files data.
Related
Today I have a problem with phpmyadmin and redis, meaning that when I try to view the phpmyadmin management page the following error appears:
phpMyAdmin - Error
Error during session start; please check your PHP and / or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.
session_start (): Cannot find save handler 'redis' - session startup failed.
Note that if I go to the terminal, and do the command redis-cli everything works perfectly.
Why is this happening?
I had the same error.
The problem was here in the php.ini file.
I had to copy the following into the php.ini file:
session.save_path= "tcp://host1:6379?weight=1, tcp://host2:6379?weight=2&timeout=2.5, tcp://host3:6379?weight=2&read_timeout=2.5"
The solution was to replace host1, host2, and host3 with localhost:
session.save_path= "tcp://localhost:6379?weight=1, tcp://localhost:6379?weight=2&timeout=2.5, tcp://localhost:6379?weight=2&read_timeout=2.5"
In Laravel 5 I configured two remote servers in config/remote.phpand I used it for more than a year. When I added a third server now it always triggered this error
"laravel Remote connection [servername] not defined."
I answer my own question because I can't find the correct answer anywhere and I spent few hours to fix it. I believe this may help others or help myself in future.
After trying everything, I suspected that the configuration is not served from config/remote.php so i renamed config/remote.php to config/remote.php1 now also both servers added last year worked without issue so i searched my app directory
grep -iRl "myoldservername.com"
it returned with
bootstrap/cache/config.php
config/remote.php1
config/remote.php.save
I confirmed that the remote server configuration has been served from cached config file.
I renamed config/remote.php1 back to config/remote.php again and executed
php artisan cache:clear
php artisan config:clear
Now the new and old servers worked fine.
I need to alter some of the front-end features of a Laravel application that was not created by me. The application was created using Laravel and am not sure how to get it up and running so I can alter the front-end code. I was given a copy of the source files. I then put that source files in to my xampp/htdocs folder. I started Xampp, opened the folder in Gitbash and entered PHP artisan serve. The application does not appear to be running.
Is there something I am missing or doing wrong? Please take into consideration that I did not create this application, for your information, I do know how to create and run a Laravel app locally, but am wondering if the process is different if it was not created by me personally?
Thank you all for helping me out, I appreciate you personally and this community.
Here is the error I am receiving in Gitbash:
PHP Warning:
require(C:\xampp\htdocs\appoets\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in C:\xampp\htdocs\appoets\bootstrap\autoload.php on line 17
Warning: require(C:\xampp\htdocs\appoets\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\appoets\bootstrap\autoload.php on line 17
PHP Fatal error: require(): Failed opening required
'C:\xampp\htdocs\appoets\bootstrap/../vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\appoets\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\appoets\bootstrap/../vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\appoets\bootstrap\autoload.php on line 17
Please solved this for me. If you run into the same error. Have the correct file path open in Gitbash and then run "composer install"
After that was fixed another problem popped up. I went to load Laravel in my browser and it gave a general error message no error number or anything. To fix this go to your env.example file and rename it. .env then go to the terminal or your command line and run php artisan key:generate. After this hit save all and go refresh. All should be fixed!
The errors your getting are because you haven't installed your composer dependencies. Install them with composer before running the application:
composer install
Here's the old answer before that callstack was provided. I think it's still interesting background information for you, but not immediately relevant.
It looks like you're running two web servers so I suspect you're just
confused about where the application is running.
XAMPP ships with Apache. I'd expect that running it will spin up its
web server on port 80, the default port that web browsers use.
Therefore, if you're trying to get to the application at
http://localhost, you're hitting this webserver, which might have a
different (and not set up) application on it.
Running php artisan serve will start a second web server utilizing
PHP's built in web server. According to the documentation, the
default port that this command will use is 8000:
By default the HTTP-server will listen to port 8000. However if that
port is already in use or you wish to serve multiple applications this
way, you might want to specify what port to use. Just add the --port
argument:
Therefore, you can access the application without XAMPP though this
url: http://localhost:8000
Try both URLs.
Note that php artisan serve doesn't start up a MySQL server. You
will still need XAMPP to start the MySQL server if you're using a
database.
Checklist for your issue
1. composer update --no-scripts or composer install
2. php artisan key:generate
3. rename example.env to .env
4. Change database credentials, set debug mode! Change app url
4. php artisan migrate(make sure u have the database running in the server)
5. php artisan config:clear
6. you are good to go!
I am taking the "Laravel 5.4 From Scratch' course on Laracasts. I created two projects and everything was working well, but I realized that the server stopped showing me debug errors. It now throws the generic 'Sorry, page could not be found' error in BOTH applications (completely separate from each other), I run them with php artisan serve.
Laravel is ignoring the APP_DEBUG=true and APP_ENV=local in .env file.
In config/app.php:
'env' => env('APP_ENV', 'local');
'debug' => env('APP_DEBUG', true);
The application doesn't show debug, just some regular simple 'this page can not be found' errors.
I've tried:
rebooting the server
php artisan config:clear
php artisan optimize
php artisan cache:clear
nothing works, the environment is still production-like, doesn't display any errors.
How to turn on debugging?
UPDATE: php artisan env returns local but on the browser-side nothing changes, still generic user-friendly error pages. I tried on different browsers and clearing browser cache, nothing works.
The error you mention is a 404, not an error when the app fails, so the error has not much to say.
Try writting some breaking code to see the detailed debugging error
If both apps started to show that error in well-known routes you had working before, maybe you modified something that breaked all the routes and you cannot match any of them.
I have a queued job that is supposed to send emails. I keep getting an error:
Swift_TransportException(code: 530): Expected response code 250 but
got code \"530\", with message \"530 5.7.1 Authentication
required\r\n\" at
/my/project/path/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:383
I tried using mail, sendmail and smtp drivers. However if I set config values directly via mail.php in config dir it seems to work fine.
Once I get back to .env configuration it's the same problem again.
I tried outputting .env and config values in my templates - they all seem fine.
Any ideas what might be causing this?
The problem was in queue:listener.
Spend a lot of time trying to figure out why my config is being replaced with a wrong one.
Finally killing the php artisan queue:listen process and letting supervisor restart it solved everything.
Still not sure what was causing that. Maybe the .env was cached or something. Restarting the process did the trick.
It occurs just because your changes are not detected by artisan so it requires restarting artisan. There is nothing to do with php artisan queue:listen