I am trying to achieve this because I am running an import file function at below URL using AJAX. It will take 15 mins or more to complete the insertion of data.
[Tab 1] https://example.com/controller/import-file
I want to see the log I have added in DB using Yii2 Logger on the second tab.
[Tab 2] https://example.com/controller/view-log
While the TAB 1 process runs, the second tab log is not loading the data; instead, it is just waiting for tab 1 request to get completed.
I am running Yii2 in Amazon EC2.
Is there anything I have to do with MPM_Worker or MPM_Prefork or MPM_Events? If yes, kindly guide.
I refer this guide:
February 1, 2021, 3:38pm
That sounds like blocking in standard PHP sessions. Try switching to Redis for sessions.
Any guide to implementing Redis in Yii2? First time I heard this
Will it affect the login functionality?
The real case is as below:
User Logged in to Account > Import Data > Fetch using APIs > Script will add logs in database > In a new tab of the same browser > user can see the logs or can perform any other action.
February 3, 2021, 8:50am
Any other solution except manipulating session? I tried to implement it, but it broke the system so any Apache or PHP configuration would be a nice option.
February 4, 2021, 8:19am
@samdark Thank you so much for guidance. I have successfully achieved it.
If anyone wants to know:
Install Redis-Server in your webserver, using
digitalocean link or for AWS EC2
Install PHP Redis extension.
Apply session.save_path & session.save_handler in php.ini
Restart the server
Apply Redis session in Yii2 Component as
Refer to this article to add ElastiCache Redis to Yii2