2 different php requests per user at a time

I have a website that has 2 pages, (home_page.php and action_page.php). The action page takes aprx. 2 minutes for a full load (server side takes 2 minutes). But if the user clicks the link to the main page while loading the action page, the browser does not go to the home page until the action page is fully loaded. Same thing if the home page opens in a new tab.

First of all, what is the reason for this? (bowser? php? apache?) and how can I avoid this?

thanks

+7
url browser php apache
source share
3 answers

Most likely, this is due to the fact that the session is blocked. PHP allows only one request per session to prevent problems (data overwriting, etc.). See: session_write_close () ...

+10
source share

If the page loads 2 minutes, you reach the limits of the network timeout of a typical browser. It really is a very long time to load the page. You might want to consider creating a separate process for processing lengthy processing. You can put the result in a database, file, etc. And use the survey to check if this is done.

If a process (exec ()) occurs, make sure that you use nohup, background it (&) and direct error output in / dev / null, otherwise it will not be disconnected from the web process and the web process will wait for completion.

+1
source share

Also pay attention to your debugging settings if you are developing. I have this in my .htaccess:

php_flag xdebug.remote_enable on php_flag xdebug.remote_connect_back on php_flag xdebug.remote_autostart on 

And that creates the same behavior.

0
source share

All Articles