Running Php without any restriction ?

Discussion in 'PHP' started by ironmankho, Dec 20, 2011.

  1. #1
    Running Php without any restriction ?

    i am running php in my PC for downloading webpages VIA cURL
    i already removed script time excecuaion
    My problem is how i remove Php restriction to run free mode .. i want run a a php script as long as as 10 hour ..so it run on local host that's why i have no problem of CPU,Ram usage
     
    Solved! View solution.
    ironmankho, Dec 20, 2011 IP
  2. luckyguy354

    luckyguy354 Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    How is your script? AFAIK, if you grab some webpages, some times you'll run out of memory.

    My sugestion is use meta tag refresh for grab every page.
     
    luckyguy354, Dec 20, 2011 IP
  3. #3
    From your description it also seems that you'd win if you shifted from PHP and went for a programming language that supports concurrency (threads), namelly if you have a multi-core CPU (Python, Ruby or even Java).

    Answering directly to your question - try running the script via CLI (console) as there aren't no time limits for executing. Also on the top of your script set the memory_limit directive to a value that suits you:

    <?php ini_set('memory_limit', '1G');
    PHP:
    Whatever limit you set there, just keep in mind that if you don't do some memory management along your script, you may eventually run out of memory - even if you set 1GB of maximum memory.
     
    proactiv3, Dec 21, 2011 IP
  4. ironmankho

    ironmankho Active Member

    Messages:
    393
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #4
    Please tell me how i can memory management because i have no idea about it

    thanks for your replay
     
    ironmankho, Dec 21, 2011 IP
  5. proactiv3

    proactiv3 Peon

    Messages:
    55
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    0
    #5
    As I mentioned before PHP is clearly not the best language for what you're trying to accomplish. Anyway, take a look at the memory_get_usage and the memory_get_peak_usage functions.

    For further pointers we need to know what you are trying to achieve.
     
    proactiv3, Dec 21, 2011 IP