javier_domenech
javier_domenech

Reputation: 6253

failed to open stream: File name too long

I'm facing this error when trying to get the contents of a url:

failed to open stream: File name too long in ...

Code:

    $url = "/var/www/vhosts/myvhost/scripts/needed_script.cgi?needed_param1=some_value&needed_param2=some_value&needed_param3=some_value"; // and continues up to a long of 926 chars

    $url = str_replace(' ','%20',$url);

    $web = file_get_contents($url);

    $web = implode('', $web );

Is there anything I can do to avoid this error? Some php.ini setting or anything..

It happens with a new server with PHP 5.3, on the old one, with PHP 4.3 didn't happen.

Upvotes: 1

Views: 5813

Answers (1)

Shira
Shira

Reputation: 6560

You can't pass query parameters to a filesystem path.

Upvotes: 1

Related Questions