Why can't I fetch www.google.com with Perl's LWP::Simple?

前端 未结 4 569
长情又很酷
长情又很酷 2021-01-26 09:00

I cant seem to get this peice of code to work:

    $self->{_current_page} = $href;
    my $response = $ua->get($href);
    my $responseCode = $response->         


        
4条回答
  •  走了就别回头了
    2021-01-26 09:35

    Check your SELinux settings.

    SELINUX enabled systems will not allow an outgoing connection from a web agent (httpd).

    This page can tell you more about SELinux and HTTPD settings: http://wiki.centos.org/TipsAndTricks/SelinuxBooleans

    Enable outbound web connections from Apache in a Perl script:

    # setsebool -P httpd_can_network_connect on
    

提交回复
热议问题