Menu

#62 PHPCrawl doesn't work - please help.

closed-duplicate
nobody
9
2014-12-22
2014-01-13
Anonymous
No

Hi there.
I just downloaded PHPCrawl, and I can't seem to make it work. I'm trying to run example.php as shown on their webpage: http://phpcrawl.cuab.de/example.html, but it gives me this error:

Warning: unlink(): No such file or directory in .../PHPCrawl_081/libs/PHPCrawlerUtils.class.php on line 572

Fatal error: Uncaught exception 'Exception' with message 'Error creating working directory '/phpcrawl_tmp_26711389643165/'' in .../PHPCrawl_081/libs/PHPCrawler.class.php:782 Stack trace: #0 ...PHPCrawl_081/libs/PHPCrawler.class.php(276): PHPCrawler->createWorkingDirectory() #1 .../PHPCrawl_081/libs/PHPCrawler.class.php(532): PHPCrawler->initCrawlerProcess() #2 .../PHPCrawl_081/libs/PHPCrawler.class.php(330): PHPCrawler->startChildProcessLoop() #3 .../PHPCrawl_081/example.php(62): PHPCrawler->go() #4 {main} thrown in .../PHPCrawl_081/libs/PHPCrawler.class.php on line 782

Can anyone help me please?
I'm really stuck here :(

Thanks in advance, Mathias Lund.

Discussion

  • Anonymous

    Anonymous - 2014-01-14

    Hi Mathias!

    Are you using windows?

    If so, this probably is the (open) bug as described here:
    http://sourceforge.net/p/phpcrawl/bugs/57/

    The detection of the system-temp-dir fails.

    This will get fixed in the next version.

    For a temporary workaround, please set the temp/working-directory of the crawler manually by using setWorkingDirectory() brefore calling the go method in your script.
    (http://phpcrawl.cuab.de/classreferences/PHPCrawler/method_detail_tpl_method_setWorkingDirectory.htm)

    This can be any writablwe direcrtory on you system.

    Please let me know if this works for you.

     
  • Anonymous

    Anonymous - 2014-01-14

    Hi! Thanks for your support, but I still can't make it work.
    I'm running on OSX.
    I'm not sure what you mean by manually setting a setWorkingDirectory().

    Does that mean that I place
    $crawler->setWorkingDirectory("/tmp/");

    in example.php, and create a new folder named "tmp" in my project?

    I'm kind of new to crawling sorry :)

    Thanks for aiding me!

     
  • Uwe Hunfeld

    Uwe Hunfeld - 2014-01-15

    Yes, just set the working directory to ANY existing and writeable directory you want.
    phpcrawl just needs it to store some temporary data.

    Like $crawler->setWorkingDirectory("/home/me/dontknow/temp/");

    BTW: "/tmp/" is NOT in your project-directory, that would be "./tmp/".

     
  • Anonymous

    Anonymous - 2014-01-15

    Man thank you so much!! I just edited the WorkingDirectory in PHPCrawler.class.php to a folder on my desktop.

    I wouldn't have been able to do it without your assistance.
    Thank you so much!

     
  • Anonymous

    Anonymous - 2014-01-15

    OK! So im closing this since the bug is already reportet here:
    http://sourceforge.net/p/phpcrawl/bugs/57/

    Good luck!

     
  • Uwe Hunfeld

    Uwe Hunfeld - 2014-01-15
    • status: open --> closed-duplicate
     
  • Anonymous

    Anonymous - 2014-12-22

    I did this just before $crawler->go();

    $crawler->setWorkingDirectory("./tmp/");

    And I created a tmp folder in the same directory as my example.php. Doesn't work, gives the same error.

     
  • Uwe Hunfeld

    Uwe Hunfeld - 2014-12-22

    Hi!

    Just seems that phpcrawl doesn't have the permission to write to you tmp-dir.
    Get sure the user who runs phpcrawl has the permission.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.