1

I just installed wordpress with plugins, everything works find except on a 'contact me' page, where I can see an error like this.

Warning: getimagesize(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/foobar.com/wp-content/themes/foobar/backend/theme-components/cs-header/cs_functions.php on line 751

Warning: getimagesize(http://dev.foobar/wp-content/uploads/2015/11/subheader-image-jobline-1.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/foobar.com/wp-content/themes/foobar/backend/theme-components/cs-header/cs_functions.php on line 751

cs_functions.php on line 751 is:

    if (is_file($cs_upload_dir . $cs_img_name) || is_file($cs_images_dir . $cs_img_name)) {
        if (ini_get('allow_url_fopen')) {
            if ($header_banner_image <> '') {
                $banner_image_height = getimagesize($header_banner_image);
            }
        }
    } else if (isset($cs_upload_subdir_file) && is_file($cs_upload_dir . $cs_upload_subdir_file)) {
        if (ini_get('allow_url_fopen')) {
           // THIS IS LINE 751
          $banner_image_height = getimagesize($header_banner_image);
        }
    } else {
        $banner_image_height = '';
    }

So, I went to /etc/php.ini and checked allow_url_fopen and it is set to on

allow_url_fopen = On

What is going on? and how do I fix it

0

I'm assuming WP is installed locally, did you make sure to edit your hosts file. Example:

127.0.0.1 dev.foobar
  • Yes. I am sure I have that in my hosts file. Otherwise, I wouldn't even have seen the frontpage of my WP site – user7342807 Mar 6 '17 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.