lordphate Posted January 14, 2009 Share Posted January 14, 2009 Hey guys, I'm running php 5.2.8 [the newest] on centOS I'm getting : Fatal error: Only variables can be passed by reference in /home/deathbyb/public_html/modules/imports.php on line 58 I've never seen this error before, here's line 58 $fh = fsockopen($values["video"], 80, $errno, 300); Any suggestions ? Quote Link to comment https://forums.phpfreaks.com/topic/140868-solved-fatal-error-only-variables-can-be-passed-by-reference-in/ Share on other sites More sharing options...
premiso Posted January 14, 2009 Share Posted January 14, 2009 Post line 48-68 for us to better help you. And a google of the error: http://the-stickman.com/web-development/php/php-505-fatal-error-only-variables-can-be-passed-by-reference/ That should explain what is happening better. Quote Link to comment https://forums.phpfreaks.com/topic/140868-solved-fatal-error-only-variables-can-be-passed-by-reference-in/#findComment-737322 Share on other sites More sharing options...
lordphate Posted January 14, 2009 Author Share Posted January 14, 2009 $curl = curl_init(); curl_setopt($curl, CURLOPT_URL,$LOGINURL); curl_setopt($curl, CURLOPT_USERAGENT, $agent); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS,$POSTFIELDS); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_REFERER, $reffer); curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path); $store = curl_exec ($curl); $url = $values["video"]; $fh = fsockopen($url, 80, $errno, 300); if(!$fh) { return $errno; } else { $headers = get_headers($values["video"],1); print_r($headers);exit; } $hdr .= "POST ".$headers["0"]." HTTP/1.0\r\n"; $hdr .= "Host: $host\r\n"; $hdr .= "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n"; $hdr .= "Content-Type: application/x-www-form-urlencoded\r\n"; $hdr .= "Content-Length: ".strlen($uri)."\r\n"; $hdr .= "Connection: close\r\n\r\n"; and believe it or not i did google it, but everything was saying it was a bug in 5.0.5... Quote Link to comment https://forums.phpfreaks.com/topic/140868-solved-fatal-error-only-variables-can-be-passed-by-reference-in/#findComment-737326 Share on other sites More sharing options...
lordphate Posted January 14, 2009 Author Share Posted January 14, 2009 okay here is my newest code $host_details = parse_url($values["video"]); $host = $host_details["host"]; $fh = fsockopen($host, 80, $errno, 5); if($fh) { return "error"; } else { i know $values["video"] is set... Quote Link to comment https://forums.phpfreaks.com/topic/140868-solved-fatal-error-only-variables-can-be-passed-by-reference-in/#findComment-737345 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.