Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Apr 2009
    Posts
    135
    Thanks
    83
    Thanked 0 Times in 0 Posts

    Running .php In Multiple Instances?

    I have written a script in PHP and CURL that uses proxies to access webpages to check if the error number (If error number) that they return.

    The script runs a loop in my database which is pretty much endless, there is so much data to run through it would never really finish.

    If I open up MSIE & FF and load the script in both browsers will the script still go to the correct URL's that it is looping and use the correct details etc?

    Also, is it a max connections per server type issue as to why I cannot load my script in 2 tabs in firefox, instead I have to load it in multiple browsers?

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    If I understand you correctly, you want php to run indefinitely, and then access information from that particular script (its location and whatnots) correct?
    No, you cannot access these directly then. What you need to do is create a service type idea with php, running a while(true) against it, and ignoring user abort. This can be launched and if set up as a soap server or using fsockopen, you can listen for requests from other script and provide responses. This way, everybody that access it will have the same data provided back.
    Without this method, each client to the script will execute it starting on line 1 and go from there (which it doesn't sound like you're looking to do).

    As for you're max_connections, I can't see that being an issue with multiple tabs in firefox. My guess is its taking so long to process it doesn't have the time to reply to you properly.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • Users who have thanked Fou-Lu for this post:

    Sussex_Chris (02-17-2010)

  • #3
    Regular Coder
    Join Date
    Apr 2009
    Posts
    135
    Thanks
    83
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    If I understand you correctly, you want php to run indefinitely, and then access information from that particular script (its location and whatnots) correct?
    No, you cannot access these directly then. What you need to do is create a service type idea with php, running a while(true) against it, and ignoring user abort. This can be launched and if set up as a soap server or using fsockopen, you can listen for requests from other script and provide responses. This way, everybody that access it will have the same data provided back.
    Without this method, each client to the script will execute it starting on line 1 and go from there (which it doesn't sound like you're looking to do).

    As for you're max_connections, I can't see that being an issue with multiple tabs in firefox. My guess is its taking so long to process it doesn't have the time to reply to you properly.
    Eventually I will have the script running while ignoring user abort but for the time being and testing purposes I do not want this feature added, instead I want to add a load of tabs to check out the stress on my server and make sure that everything is running as it should do as while running it in 1 tab it is not very fast at all.

    I'm not sure if it's the reply that is having an issue because I have got 3 PC's with MSIE, FF and Opera open running it just fine but if I have 1 PC with 2 tabs in FF it wont load for some reason that I simply cannot work out!

    Running the script from A-Z / Start To User Quit is what I am trying to do at the moment to confirm that there are no issues with it.

  • #4
    Regular Coder
    Join Date
    Apr 2009
    Posts
    135
    Thanks
    83
    Thanked 0 Times in 0 Posts
    An addition to the above issue of not being able to have multiple tabs is also downloads. If I download a, say 30MB file, from my server, during its download I cannot also browse my own site in that same browser. I can if I open up MSIE or other but not in the same browser as the download is active.

    My server has a 100MBPS port and I can open up in other browsers which is what really confuses me :S

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Quote Originally Posted by Sussex_Chris View Post
    An addition to the above issue of not being able to have multiple tabs is also downloads. If I download a, say 30MB file, from my server, during its download I cannot also browse my own site in that same browser. I can if I open up MSIE or other but not in the same browser as the download is active.

    My server has a 100MBPS port and I can open up in other browsers which is what really confuses me :S
    Best I can tell, thats just the browser. FF in both multiple tabs and in multiple windows waits for one script to complete before executing the next. This behaviour does not exist with different browsers running, and it does not work this way in IE.
    Don't know whether this is considered how its supposed to work, or if its a bug in FF.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •