Autoenable maintenance mode in Laravel - laravel-5

I am using Laravel 5.6. sometime my server goes down, sometimes webserver(apache2) is ok but mysql server is down. in that case while opening application its showing me errors and exception(in case of mysql server down). how can i activate maintenance mode automatically when such thing happen. Thanks for your help in advance.

You can't activate maintenance mode when your server is down. Because when server is down it can't run PHP script.
For mysql you can create a middleware which checks your DB connection on each request and if it fails, you can use this.
Artisan::call('down');
Or you can show custom created page which shows the "Site is down temporarily"

Related

WebSocket('ws://example.com:8080') works but not WebSocket('wss://example.com:8080')

I need help from the expert and feels like this is beyond my paygrade. I have xampp installed on a windows machine. I have a php page that i access using https://example.com/test.php and inside that php page, it calls a javascript. It did not worked. I got this error:
can’t establish a connection to the server at wss://example.com:8080/
But the everything seems to be working when I access the page as http://example.com/test.php and calls the WebSocket('ws://example.com:8080'). Did I missed anything on my httpd conf?
Thank you

Sending emails via gmail, Laravel

can anyone know if there is any difference in sending emails via gmail in Laravel 5.5 on localhost and on global server, because on localhost everything works fine, emails are sent without problem but on global server all the time crashes my authentication error go on configuration connection does not change. Of course, I have enabled mail access for less secure applications. I wonder if it's a problem with mail or a change of environment, from local to global, or something else must change in the .env file configuration or directly in the application. Thank you in advance for your help
Yes. Possibly it occurred because of app environment. Try keeping debugging on. And trace back the authentication error. Try sending dummy email with simple text.
And after making changes in env file empty config caches using php artisan cache:clear. Many times config doesn't change because of caching.
Good Luck!

Codeigniter 2.x website is not executing methods after migrating to CentOS + WHM server

Folks,
We have a website running with CodeIgniter 2.x optimized with PHP 5.3.x when it was developed some 3-4 years back. It was very stable for few years until we didn't migrate it to a new Server based with CentOS + WHM + PHP 5.5.x. I tried talking to GoDaddy if they can downgrade the server to PHP 5.3.x but they refused to do that.
Interesting is, after migration, website still running fine and users can login and browse all the functionality etc but when a request is generated to manipulate / CRUD database then nothing happens except returning to that very same page without any update. Right after a CRUD request, pressing CTRL+F5 does the magic and the request gets a success. I tried making the requests by opening Console in Chrome browser by enabling 'Disable Cache' and everything works fine.
There is no Caching is setup under CodeIgniter nor under OS / WHM etc, I'm sure about that. I'm having no clue about the scenario.
Has anyone experienced the same ever or can suggest doing something to resolve the matter.
P.S: Another website developed with same Code-base / Architecture is running perfectly on the described new server.

Laravel won't route on production server

Just getting started with laravel and have run into some trouble.
Before committing to using laravel I wanted to build a very basic web app to test the waters via homestead and then move that web app to a remote server in order to see how easy the process was.
So I've got homestead up and running and have built a very basic web app and it works perfectly locally.
However when I moved the laravel project onto the remote server the routing stopped working.
For example locally testProject.dev/contact takes me through to a mock 'contact us' view. However when I try that on productionServer.com/contact I'm greeted by a 403 'you do not have permission to access contact on this server'.
Am I missing something in laravel here or is this an issue with the sever setup?
Any help would be greatly appreciated. Thanks
Update -> This turned out to be an issue with another piece of software running on the server. Thanks for all the help.

Database Connection unresponsive - Sybase

I am trying to connect to a sybase ASE 15 enterprise edition database. Initially the connection is working fine but suddenly the page becomes unresponsive. There are no exceptions in the log nor is there any error displayed on the page. Also I have noticed that only the connection related to a particular database is unresponsive and remaining all are working just fine. However, if I restart the server, everything's working fine.
I have tried to increase the number of user connections and modified sytem configurations. But the result is all the same. Please help me out
I recommend you trace the session to get more log information:
1- initiate a connection to the database
2- use the stored procedure'sp_who' to identify the spid of the process of your connection on the server side
3- set up the trace file for this spid:
set tracefile 'log_file' for spid
(follow doc: http://www.sybase.com/files/White_Papers/ASE15-apptrace-070507-wp.pdf
OR
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00743.1502/html/queryprocessing/BABJDBHJ.htm )
4- analyze your log file
let us know if it helped.

Resources