Tagged: ismael
-
AuthorPosts
-
November 11, 2016 at 5:22 am #710997
We are getting this error at the top of our site:
Notice: Undefined variable: http_response_header in /public_html/wp-content/themes/enfold/framework/php/function-set-avia-frontend.php on line 637I’ve already reinstalled twice and disabled plugins, nothing is helping. What can we do?
November 11, 2016 at 7:55 am #711012Hi pippylu!
Please reupload the theme through ftp and let us know if that will solve your issue.
Thanks a lot
Regards,
BasilisNovember 23, 2016 at 3:06 am #715688We already tried this an it did not help.
November 25, 2016 at 6:33 am #716663Hi,
We have reported the issue to Kriesi. Please post the FTP details here so that we can do a few tests.
Best regards,
IsmaelNovember 25, 2016 at 7:44 pm #717020FTP info below:
November 30, 2016 at 5:01 am #718620Hi,
Thank you for the info. Did you delete this video file?
// Fran-Connect-2-0-FINAL.webm
We modified the wp-config.php file to hide the errors temporarily.
define('WP_DEBUG_DISPLAY', false);
Best regards,
IsmaelNovember 30, 2016 at 11:51 pm #719030This is a dev site so you don’t need to hide it, we already have it hidden on the live site. I want to see the errors so I know they’ve gone away.
I don’t know anything about that video file – is that what is causing the issue?December 5, 2016 at 5:37 am #720292Hi,
Yes, the conditional function is called whenever a media file is added to the theme. Unfortunately, this function is causing an issue because the array that is supposed to be populated when calling the file_get_contents function is blank or undefined. Please try to clean up the database using this plugin.
// https://wordpress.org/plugins/wp-optimize/
Best regards,
IsmaelDecember 8, 2016 at 9:25 pm #722182Where is there a reference to that video file? Running WP Optimize did not help. I searched the entire database and see no reference to Fran-Connect-2-0-FINAL.webm. Just Fran-Connect-2-0-FINAL.mp4 which is used on the homepage and exists.
- This reply was modified 8 years ago by christiemade.
December 13, 2016 at 5:48 am #723526Hi,
The error is due to the mp4 video inside the color section. You need to use the absolute instead of the relative url.
// http://unlikelyheroine.com/wp-content/uploads/2016/10/Fran-Connect-2-0-FINAL.mp4
Best regards,
IsmaelMay 11, 2017 at 3:36 pm #791686Hi Ismael,
I have exactly the same error:
Notice: Undefined variable: http_response_header in /public_html/wp-content/themes/enfold/framework/php/function-set-avia-frontend.php on line 637
Notice: Undefined variable: http_response_header in /public_html/wp-content/themes/enfold/framework/php/function-set-avia-frontend.php on line 637
Notice: Undefined variable: http_response_header in /public_html/wp-content/themes/enfold/framework/php/function-set-avia-frontend.php on line 637On the homepage of one of our sites.
I have reinstalled the theme, tested with no plugins activated, optimised the database, tried the link to a video in the first color section as relative and absolute, www and non-www, https & http.
The site is https://www.webworksuk.com/
What have we missed?
Thanks,
JoeMay 12, 2017 at 4:34 am #792020Hi,
Please edit the framework > php > function-set-avia-frontend.php file then look for the avia_is_200() function. Replace it with the following code.
if(!function_exists('avia_is_200')) { function avia_is_200($url) { $options['http'] = array( 'method' => "HEAD", 'ignore_errors' => 1, 'max_redirects' => 0 ); $body = @file_get_contents($url, NULL, stream_context_create($options), 0, 1); if(isset($http_response_header[0])) { sscanf($http_response_header[0], 'HTTP/%*d.%*d %d', $code); } else { $headers = get_headers($url); sscanf($headers[0], 'HTTP/%*d.%*d %d', $code); } return $code === 200; } }
Best regards,
IsmaelMay 12, 2017 at 12:01 pm #792235Hi Ismael,
Will this be included in the next update?
Thanks,
JoeMay 12, 2017 at 12:11 pm #792237Hi Ismael,
That’s produced the foollowing errors in place of the orginal:
Warning: get_headers(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/webworksuk/public_html/wp-content/themes/enfold/framework/php/function-set-avia-frontend.php on line 640
Warning: get_headers(): This function may only be used against URLs in /home/webworksuk/public_html/wp-content/themes/enfold/framework/php/function-set-avia-frontend.php on line 640
Warning: get_headers(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/webworksuk/public_html/wp-content/themes/enfold/framework/php/function-set-avia-frontend.php on line 640
Warning: get_headers(): This function may only be used against URLs in /home/webworksuk/public_html/wp-content/themes/enfold/framework/php/function-set-avia-frontend.php on line 640
Warning: get_headers(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/webworksuk/public_html/wp-content/themes/enfold/framework/php/function-set-avia-frontend.php on line 640
Warning: get_headers(): This function may only be used against URLs in /home/webworksuk/public_html/wp-content/themes/enfold/framework/php/function-set-avia-frontend.php on line 640
May 12, 2017 at 8:40 pm #792488Hi,
Please ask your hosting provider to fix the problem.
It is located here
allow_url_fopen=0as they are blocking it.
Thank u
Best regards,
BasilisDecember 18, 2019 at 4:16 pm #1167342This issue persists (2019-12-18, Enfold v4.6.3.1).
allow_url_fopen = 0 is a good security setting in a shared environment (notice: it also disables get_headers(), so if one is not available – so is the other!). I have a better fix for this situation, since all you really need to know is whether the remote URL exists or not:
if(!function_exists('avia_is_200')) { function avia_is_200($url) { if ( ini_get('allow_url_fopen') ) return __avia_is_200_helper_fopen($url); else if ( function_exists("curl_init") ) return __avia_is_200_helper_curl($url); else return false; } function __avia_is_200_helper_fopen($url) { $options['http'] = array( 'method' => "HEAD", 'ignore_errors' => 1, 'max_redirects' => 0 ); $body = @file_get_contents($url, null, stream_context_create($options), 0, 1); sscanf($http_response_header[0], 'HTTP/%*d.%*d %d', $code); return $code === 200; } function __avia_is_200_helper_curl($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_NOBODY, true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); // security isn't an issue in this case, and you can skip maintaining the root CA .pem required for this curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return $code === 200; } }
- This reply was modified 5 years ago by ellmann_creative.
December 23, 2019 at 7:28 pm #1168803Thanks, ellmann_creative, that worked for me too.
I’d be bummed if I had to carry this in my child theme forever, if it’s a core issue…
December 24, 2019 at 6:53 pm #1168958Hi launchmoxie,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.