Page request not responding until page is being processed - PHP

Page request not responding until page is being processed - PHP

am 05.03.2011 21:06:40 von luci spam

--000e0cd32e2e079989049dc1cd33
Content-Type: text/plain; charset=ISO-8859-1

This must be a newbie question!

I'm not sure if this is either PHP / MySQL / Apache problem, so any help is
appreciated. I have a XAMPP setup in my PC.

Shortly, I have a two seperate codes as the following,
Code_A.php - looping code. this may take several minutes
Code_B.php - a quick simple echo page from mysql database

I want to open Code_B.php no matter Code_A is being processed or not.
However, when I try to open Code_B while Code_A is being running
Code_B won't open until Code_A will finish.

I thought maybe my server is too busy processing Code_A, so I added the
following to Code_A.php (looping code)
sleep (rand(1,3)); - expecting Code_B will open while Code_A rests for secs.

MySQL tables are all innoDB, so I think in theory Code_B should open at some
point even though Code_A is being looped. But it doesn't!!

Where should I start? (MySQL Priorities? Apache setup? or else?)

Thanks in advance.

--000e0cd32e2e079989049dc1cd33--

Re: Page request not responding until page is being processed - PHP

am 05.03.2011 21:52:16 von Reindl Harald

--------------enig356108644FC195151D9BC9E9
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

This is mysql-independent

If your php-scripts using sessions the session.file
is locked until end of the request, so if there
are multiple requests (as sample framesets) you
have to decide the point where are no wirtes
into the $_SESSION-Array are expected and use
session_write_close()

Directly after session_write_close() the second script whith
the same session can start because it has waited for
the lock of the session file

the same for downloads via php
if there is a open session you must wait until the
download is finished to use the website

Am 05.03.2011 21:06, schrieb luci spam:
> This must be a newbie question!
>=20
> I'm not sure if this is either PHP / MySQL / Apache problem, so any hel=
p is
> appreciated. I have a XAMPP setup in my PC.
>=20
> Shortly, I have a two seperate codes as the following,
> Code_A.php - looping code. this may take several minutes
> Code_B.php - a quick simple echo page from mysql database
>=20
> I want to open Code_B.php no matter Code_A is being processed or not.
> However, when I try to open Code_B while Code_A is being running
> Code_B won't open until Code_A will finish.
>=20
> I thought maybe my server is too busy processing Code_A, so I added the=

> following to Code_A.php (looping code)
> sleep (rand(1,3)); - expecting Code_B will open while Code_A rests for =
secs.
>=20
> MySQL tables are all innoDB, so I think in theory Code_B should open at=
some
> point even though Code_A is being looped. But it doesn't!!
>=20
> Where should I start? (MySQL Priorities? Apache setup? or else?)
>=20
> Thanks in advance.
>=20

--=20

Mit besten Grüßen, Reindl Harald
the lounge interactive design GmbH
A-1060 Vienna, Hofmühlgasse 17
CTO / software-development / cms-solutions
p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40
icq: 154546673, http://www.thelounge.net/


--------------enig356108644FC195151D9BC9E9
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk1yooAACgkQhmBjz394Anl27QCdGaDD4Al8DpU0Y0krma+P UrG0
Qm8An0CWPILZSEHCEMKVcW723G8ZLtum
=S+q1
-----END PGP SIGNATURE-----

--------------enig356108644FC195151D9BC9E9--