Wamp php bir dosya indirmek için aynı siteye çağırıyor

0 Cevap php

I'm writing tests for my CodeIgniter site using simpletester. One of the things that it does is offer autogenerated files. I want to test if the output of a file is correct.

Ancak, ben bunu yaparsam:

function testFunction1(){
    $url = site_url('downloader/function1');
    $handle = fopen($url,'r');
    $contents = stream_get_contents($handle);
    echo $contents;
    fclose($handle);
}

Bu bir 404 çıktılar.

It works perfectly when I put "www.google.com" as the url. I can also download the file if I copy paste the URL in the browser.

Teşekkürler!

edit: Even if I try to download a regular file (so not a php function), with the full url, it gives the 404.

0 Cevap