Freshrss: Favicons not loading from feeds?

Created on 3 Oct 2017  ·  30Comments  ·  Source: FreshRSS/FreshRSS

Hello,
I just did a fresh install of version 1.8 and imported my feeds form a previous 1.6 installation.
Everything went fine but I got no favicons for my feeds, all articles have this icons:

fc97eec4

Is there a way to force it to load icons, or will it come at some point, or is there a problem somewhere?

Thanks!

All 30 comments

Hello @donlencho
favicons should appear by themselves, and are regularly refreshed. If you still have the problem, let us know.

Well it's been a few days now, the feeds refresh regularly, but still no favicons.
I tried changing the permissions on the data/favicons folder and the files inside, but it's not working better.
Thanks for the help in advance (although I admit I can live without favicons!).

Could you please show the content of ./FreshRSS/data/favicons/ ?

ls -alh FreshRSS/data/favicons/

If you see some *.ico files there, try to manually open some of them and check whether they are the default icon or a proper one. If they are only default icons, try to delete them:

rm FreshRSS/data/favicons/*.ico

And then force-refresh your FreshRSS home page in your Web browser.

I had actually done that before, there is one icon per feed, but they are all the default one, like mentioned in the first post. Deleting them just makes it recreate them identically on next refresh.

Please put the following script in ./FreshRSS/p/test-fav.php and access it from your browser:

<?php
error_reporting(E_ALL);

$url = 'https://alexandre.alapetite.fr/';

require('../constants.php');
require(LIB_PATH . '/lib_rss.php');
require(LIB_PATH . '/favicons.php');

header('Content-Type: text/plain; charset=UTF-8');
header('Content-Disposition: inline; filename="test-fav.txt"');

function get_favicon($url) {
    $url = trim($url);
    echo 'searchFavicon ', $url, "\n";
    $favicon = searchFavicon($url);
    if ($favicon == '') {
        $rootUrl = preg_replace('%^(https?://[^/]+).*$%i', '$1/', $url);
        if ($rootUrl != $url) {
            $url = $rootUrl;
            echo 'searchFavicon ', $url, "\n";
            $favicon = searchFavicon($url);
        }
        if ($favicon == '') {
            $link = $rootUrl . 'favicon.ico';
            echo 'downloadHttp ', $link, "\n";
            $favicon = downloadHttp($link, array(
                    CURLOPT_REFERER => $url,
                ));
            if (!isImgMime($favicon)) {
                echo 'isImgMime false', "\n";
                $favicon = '';
            }
        }
    }
    return $favicon;
}

$favicon = get_favicon($url);
if ($favicon != '') {
    echo 'Favicon retrieved successfully: ', md5($favicon), "\n";
} else {
    echo 'Error: Could not get favicon!', "\n";
}

echo 'Favicons dir writable: ', is_writable($favicons_dir) ? 'yes' : 'no', "\n";

You should have an output like:

searchFavicon https://alexandre.alapetite.fr/
Favicon retrieved successfully: 04f4d560cb92b40def3c50391c83ed94
Favicons dir writable: yes

here is what i get:

searchFavicon https://alexandre.alapetite.fr/
<!DOCTYPE html>
... your homepage I guess!
</html>
downloadHttp https://alexandre.alapetite.fr/favicon.ico
���������(�����(������ ���������������������������������������������������������������������������������������������DDDDDDDDDDDDDDDDDDDDDDDDDI�DD�DDDD�DD�DDDD����DDDDI�I�DDDDI�I�DDDDI�I�DDDDD�I�DDDDD�I�DDDDDI�DDDDDDI�DDDDDDDDDDDDDDDDDDDDDDDDDDD����������������������������������������������������������������isImgMime false
Error: Could not get favicon!
Favicons dir writable: yes

Hum, what platform are you running on? OS, PHP...

it's a Debian server I'm not running myself so I don't know everything about versions, etc.
But PHP is this package version: 5.4.45-0+deb7u11

The data should not be printed out.
Please check that the line CURLOPT_RETURNTRANSFER => true is correct on your local copy
https://github.com/FreshRSS/FreshRSS/blob/4058ff3ff4631bcc2c9cba534162c80db5cf2b65/lib/favicons.php#L36

it seems so, the line is there and I haven't touched this file since installing.

Hummmm. Please give a try to this test-curl.php:

<?php
error_reporting(E_ALL);

$url = 'https://alexandre.alapetite.fr/favicon.ico';

require('../constants.php');
require(LIB_PATH . '/lib_rss.php');

header('Content-Type: text/plain; charset=UTF-8');
header('Content-Disposition: inline; filename="test-curl.txt"');

function downloadHttp1(&$url, $curlOptions = array()) {
    echo 'downloadHttp1 ', $url, "\n";
    if (substr($url, 0, 2) === '//') {
        $url = 'https:' . $favicon;
    }
    if ($url == '' || filter_var($url, FILTER_VALIDATE_URL) === false) {
        echo 'downloadHttp1 bad filter', "\n";
        return '';
    }
    $ch = curl_init($url);
    $options_ok = curl_setopt_array($ch, array(
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT => 15,
        ));
    echo 'cURL options: ', ($options_ok ? 'OK' : 'not OK!'), "\n";
    if (defined('CURLOPT_ENCODING')) {
        curl_setopt($ch, CURLOPT_ENCODING, ''); //Enable all encodings
    }
    curl_setopt_array($ch, $curlOptions);
    $response = curl_exec($ch);
    $info = curl_getinfo($ch);
    curl_close($ch);
    if (!empty($info['url']) && (filter_var($info['url'], FILTER_VALIDATE_URL) !== false)) {
        $url = $info['url'];    //Possible redirect
    }
    print_r($info);
    return $info['http_code'] == 200 ? $response : '';
}

function downloadHttp2(&$url) {
    echo 'downloadHttp2 ', $url, "\n";
    $ch = curl_init($url);
    $options_ok = curl_setopt_array($ch, array(
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT => 15,
            CURLOPT_ENCODING => '',
        ));
    echo 'cURL options: ', ($options_ok ? 'OK' : 'not OK!'), "\n";
    $response = curl_exec($ch);
    $info = curl_getinfo($ch);
    curl_close($ch);
    print_r($info);
    return $response;
}

$favicon = downloadHttp1($url);
if ($favicon != '') {
    echo 'Favicon retrieved successfully: ', md5($favicon), "\n";
} else {
    echo 'Error: Could not get favicon!', "\n";
}

echo '====', "\n";

$favicon = downloadHttp2($url);
if ($favicon != '') {
    echo 'Favicon retrieved: ', md5($favicon), "\n";
} else {
    echo 'Error: Could not get favicon!', "\n";
}

Expected output:

downloadHttp1 https://alexandre.alapetite.fr/favicon.ico
cURL options: OK
Array
(
    [url] => https://alexandre.alapetite.fr/favicon.ico
    [content_type] => image/vnd.microsoft.icon
    [http_code] => 200
    [header_size] => 381
    [request_size] => 104
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.060329
    [namelookup_time] => 0.004292
    [connect_time] => 0.004786
    [pretransfer_time] => 0.058738
    [size_upload] => 0
    [size_download] => 318
    [speed_download] => 5271
    [speed_upload] => 0
    [download_content_length] => 318
    [upload_content_length] => -1
    [starttransfer_time] => 0.060267
    [redirect_time] => 0
    [redirect_url] => 
    [primary_ip] => 2001:41d0:a:114e::1
    [certinfo] => Array
        (
        )

    [primary_port] => 443
    [local_ip] => 2001:41d0:a:114e::1
    [local_port] => 45332
)
Favicon retrieved successfully: 04f4d560cb92b40def3c50391c83ed94
====
downloadHttp2 https://alexandre.alapetite.fr/favicon.ico
cURL options: OK
Array
(
    [url] => https://alexandre.alapetite.fr/favicon.ico
    [content_type] => image/vnd.microsoft.icon
    [http_code] => 200
    [header_size] => 381
    [request_size] => 104
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.050416
    [namelookup_time] => 6.7E-5
    [connect_time] => 0.00032
    [pretransfer_time] => 0.048254
    [size_upload] => 0
    [size_download] => 318
    [speed_download] => 6307
    [speed_upload] => 0
    [download_content_length] => 318
    [upload_content_length] => -1
    [starttransfer_time] => 0.050328
    [redirect_time] => 0
    [redirect_url] => 
    [primary_ip] => 2001:41d0:a:114e::1
    [certinfo] => Array
        (
        )

    [primary_port] => 443
    [local_ip] => 2001:41d0:a:114e::1
    [local_port] => 45333
)
Favicon retrieved: 04f4d560cb92b40def3c50391c83ed94

OK, I think we got it: I get a firewall warning, so that must be it.
What's the thing to allow: curl requests from favicon.php? Or what should I ask them to configure?
Thanks for your time!

What firewall warning do you get? And could you please test the test-curl.php above anyway?

Well, it's when trying to access the file I get a "Resource blocked, please contact us if you think it's a mistake"

I do not think this is a firewall problem. Please check that the access rights on test-curl.php are the same than on the other files. Maybe the output gets blocked because we print some debug info; in which case, please try to comment out the two lines print_r($info); in test-curl.php.

It seems it is. When I say firewall, I mean the firewall of my hosting service, not on my computer (just to be clear), with or without print_r and with 777 permissions, the "resource is blocked" by the firewall (at least that's what it's saying)

Is it a message you see in your Web browser? Does it work if you replace the content of test-curl.php with the following?

<?php
error_reporting(E_ALL);

$url = 'https://alexandre.alapetite.fr/favicon.ico';

require('../constants.php');
require(LIB_PATH . '/lib_rss.php');

header('Content-Type: text/plain; charset=UTF-8');
header('Content-Disposition: inline; filename="test-curl.txt"');

echo 'Hello World!', "\n";

yes, it's an html-formatted text saying "resource blocked by our firewall, please contact us bla bla bla".
This php file works, the echo is working.

Ok, let's put the output in a log file then. Please try this new test-curl.php:

<?php
error_reporting(E_ALL);

$url = 'https://alexandre.alapetite.fr/favicon.ico';

require('../constants.php');
require(LIB_PATH . '/lib_rss.php');

header('Content-Type: text/plain; charset=UTF-8');
header('Content-Disposition: inline; filename="test-curl.txt"');

function logme($text) {
    file_put_contents('test-curl.log', date('c') . "\t" . $text . "\n", FILE_APPEND);
}

function downloadHttp1(&$url, $curlOptions = array()) {
    logme('downloadHttp1 ' . $url);
    if (substr($url, 0, 2) === '//') {
        $url = 'https:' . $favicon;
    }
    if ($url == '' || filter_var($url, FILTER_VALIDATE_URL) === false) {
        logme('downloadHttp1 bad filter');
        return '';
    }
    $ch = curl_init($url);
    $options_ok = curl_setopt_array($ch, array(
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT => 15,
        ));
    logme('cURL options: ' . ($options_ok ? 'OK' : 'not OK!'));
    if (defined('CURLOPT_ENCODING')) {
        curl_setopt($ch, CURLOPT_ENCODING, ''); //Enable all encodings
    }
    $options_ok &= curl_setopt_array($ch, $curlOptions);
    logme('cURL options: ' . ($options_ok ? 'OK' : 'not OK!'));
    if ($options_ok) {
        $response = curl_exec($ch);
        $info = curl_getinfo($ch);
        logme(print_r($info, true));
    }
    return $info['http_code'] == 200 ? $response : '';
}

function downloadHttp2(&$url) {
    logme('downloadHttp2 ' . $url);
    $ch = curl_init($url);
    $options_ok = curl_setopt_array($ch, array(
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT => 15,
            CURLOPT_ENCODING => '',
        ));
    logme('cURL options: ' . ($options_ok ? 'OK' : 'not OK!'));
    if ($options_ok) {
        $response = curl_exec($ch);
        $info = curl_getinfo($ch);
        logme(print_r($info, true));
    }
    curl_close($ch);
    return $response;
}

$favicon = downloadHttp1($url);
if ($favicon != '') {
    logme('Favicon retrieved successfully: ' . md5($favicon));
} else {
    logme('Error: Could not get favicon!');
}

logme('====');

$favicon = downloadHttp2($url);
if ($favicon != '') {
    logme('Favicon retrieved successfully: ' . md5($favicon));
} else {
    logme('Error: Could not get favicon!');
}

echo 'Done.';

Expected output:

Done.

Expected log in test-curl.log:

2017-10-07T19:18:09+02:00   downloadHttp1 https://alexandre.alapetite.fr/favicon.ico
2017-10-07T19:18:09+02:00   cURL options: OK
2017-10-07T19:18:09+02:00   cURL options: OK
2017-10-07T19:18:09+02:00   Array
(
    [url] => https://alexandre.alapetite.fr/favicon.ico
    [content_type] => image/vnd.microsoft.icon
    [http_code] => 200
    [header_size] => 381
    [request_size] => 104
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.055867
    [namelookup_time] => 0.004238
    [connect_time] => 0.004428
    [pretransfer_time] => 0.054234
    [size_upload] => 0
    [size_download] => 318
    [speed_download] => 5692
    [speed_upload] => 0
    [download_content_length] => 318
    [upload_content_length] => -1
    [starttransfer_time] => 0.055802
    [redirect_time] => 0
    [redirect_url] => 
    [primary_ip] => 2001:41d0:a:114e::1
    [certinfo] => Array
        (
        )

    [primary_port] => 443
    [local_ip] => 2001:41d0:a:114e::1
    [local_port] => 45781
)

2017-10-07T19:18:09+02:00   Favicon retrieved successfully: 04f4d560cb92b40def3c50391c83ed94
2017-10-07T19:18:09+02:00   ====
2017-10-07T19:18:09+02:00   downloadHttp2 https://alexandre.alapetite.fr/favicon.ico
2017-10-07T19:18:09+02:00   cURL options: OK
2017-10-07T19:18:09+02:00   Array
(
    [url] => https://alexandre.alapetite.fr/favicon.ico
    [content_type] => image/vnd.microsoft.icon
    [http_code] => 200
    [header_size] => 381
    [request_size] => 104
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.051837
    [namelookup_time] => 8.6E-5
    [connect_time] => 0.000386
    [pretransfer_time] => 0.05022
    [size_upload] => 0
    [size_download] => 318
    [speed_download] => 6134
    [speed_upload] => 0
    [download_content_length] => 318
    [upload_content_length] => -1
    [starttransfer_time] => 0.051747
    [redirect_time] => 0
    [redirect_url] => 
    [primary_ip] => 2001:41d0:a:114e::1
    [certinfo] => Array
        (
        )

    [primary_port] => 443
    [local_ip] => 2001:41d0:a:114e::1
    [local_port] => 45782
)

2017-10-07T19:18:09+02:00   Favicon retrieved successfully: 04f4d560cb92b40def3c50391c83ed94

Here is the content of the log:

2017-10-08T12:13:54+02:00   downloadHttp1 https://alexandre.alapetite.fr/favicon.ico
2017-10-08T12:13:54+02:00   cURL options: not OK!
2017-10-08T12:13:54+02:00   cURL options: not OK!
2017-10-08T12:13:54+02:00   Error: Could not get favicon!
2017-10-08T12:13:54+02:00   ====
2017-10-08T12:13:54+02:00   downloadHttp2 https://alexandre.alapetite.fr/favicon.ico
2017-10-08T12:13:54+02:00   cURL options: not OK!
2017-10-08T12:13:54+02:00   Error: Could not get favicon!
2017-10-08T12:13:59+02:00   downloadHttp1 https://alexandre.alapetite.fr/favicon.ico
2017-10-08T12:13:59+02:00   cURL options: not OK!
2017-10-08T12:13:59+02:00   cURL options: not OK!
2017-10-08T12:13:59+02:00   Error: Could not get favicon!
2017-10-08T12:13:59+02:00   ====
2017-10-08T12:13:59+02:00   downloadHttp2 https://alexandre.alapetite.fr/favicon.ico
2017-10-08T12:13:59+02:00   cURL options: not OK!
2017-10-08T12:13:59+02:00   Error: Could not get favicon!

Ok, I think we have almost isolated the bug, which is during the call to the function curl_setopt_array(). One of its options is probably not available on your system, strangely. I will prepare a test.

@donlencho Could you please give a try to this new test-curl.php?

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$url = 'https://alexandre.alapetite.fr/favicon.ico';

require('../constants.php');
require(LIB_PATH . '/lib_rss.php');

header('Content-Type: text/plain; charset=UTF-8');
header('Content-Disposition: inline; filename="test-curl.txt"');

function logme($text) {
    file_put_contents('test-curl.log', date('c') . "\t" . $text . "\n", FILE_APPEND);
}

function downloadHttp3(&$url) {
    logme('downloadHttp3 ' . $url);
    $ch = curl_init($url);
    $options_ok = curl_setopt_array($ch, array(
            CURLOPT_RETURNTRANSFER => true,
        ));
    logme('cURL options: ' . ($options_ok ? 'OK' : 'not OK!'));
    if ($options_ok) {
        $response = curl_exec($ch);
        $info = curl_getinfo($ch);
        //logme(print_r($info, true));
    }
    curl_close($ch);
    return $response;
}

function downloadHttp4(&$url) {
    logme('downloadHttp4 ' . $url);
    $ch = curl_init($url);
    $options_ok = curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    logme('cURL CURLOPT_RETURNTRANSFER: ' . ($options_ok ? 'OK' : 'not OK!'));
    if ($options_ok) {
        $response = curl_exec($ch);
        $info = curl_getinfo($ch);
        //logme(print_r($info, true));
    }
    curl_close($ch);
    return $response;
}

function downloadHttp5(&$url) {
    logme('downloadHttp5 ' . $url);
    $ch = curl_init($url);
    $options_ok = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    logme('cURL CURLOPT_RETURNTRANSFER: ' . ($options_ok ? 'OK' : 'not OK!'));
    if ($options_ok) {
        $response = curl_exec($ch);
        $info = curl_getinfo($ch);
        //logme(print_r($info, true));
    }
    curl_close($ch);
    return $response;
}

function downloadHttp6(&$url) {
    logme('downloadHttp6 ' . $url);
    $ch = curl_init($url);
    $options_ok = curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    logme('cURL CURLOPT_RETURNTRANSFER: ' . ($options_ok ? 'OK' : 'not OK!'));
    $options_ok = curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    logme('cURL CURLOPT_FOLLOWLOCATION: ' . ($options_ok ? 'OK' : 'not OK!'));
    $options_ok = curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
    logme('cURL CURLOPT_MAXREDIRS: ' . ($options_ok ? 'OK' : 'not OK!'));
    $options_ok = curl_setopt($ch, CURLOPT_TIMEOUT, 15);
    logme('cURL CURLOPT_TIMEOUT: ' . ($options_ok ? 'OK' : 'not OK!'));
    $options_ok = curl_setopt($ch, CURLOPT_ENCODING, '');
    logme('cURL CURLOPT_ENCODING: ' . ($options_ok ? 'OK' : 'not OK!'));
    $options_ok = curl_setopt($ch, CURLOPT_USERAGENT, 'FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ')');
    logme('cURL CURLOPT_USERAGENT: ' . ($options_ok ? 'OK' : 'not OK!'));
    if ($options_ok) {
        $response = curl_exec($ch);
        $info = curl_getinfo($ch);
        //logme(print_r($info, true));
    }
    curl_close($ch);
    return $response;
}

logme('====');
$favicon = downloadHttp3($url);
if ($favicon != '') {
    logme('Favicon retrieved successfully: ' . md5($favicon));
} else {
    logme('Error: Could not get favicon!');
}

logme('====');
$favicon = downloadHttp4($url);
if ($favicon != '') {
    logme('Favicon retrieved successfully: ' . md5($favicon));
} else {
    logme('Error: Could not get favicon!');
}

logme('====');
$favicon = downloadHttp5($url);
if ($favicon != '') {
    logme('Favicon retrieved successfully: ' . md5($favicon));
} else {
    logme('Error: Could not get favicon!');
}

logme('====');
$favicon = downloadHttp6($url);
if ($favicon != '') {
    logme('Favicon retrieved successfully: ' . md5($favicon));
} else {
    logme('Error: Could not get favicon!');
}

echo 'Done.';

Expected output:

Done.

Expected log in test-curl.log:

2017-10-08T13:02:13+02:00   ====
2017-10-08T13:02:13+02:00   downloadHttp3 https://alexandre.alapetite.fr/favicon.ico
2017-10-08T13:02:13+02:00   cURL options: OK
2017-10-08T13:02:13+02:00   Favicon retrieved successfully: 04f4d560cb92b40def3c50391c83ed94
2017-10-08T13:02:13+02:00   ====
2017-10-08T13:02:13+02:00   downloadHttp4 https://alexandre.alapetite.fr/favicon.ico
2017-10-08T13:02:13+02:00   cURL CURLOPT_RETURNTRANSFER: OK
2017-10-08T13:02:13+02:00   Favicon retrieved successfully: 04f4d560cb92b40def3c50391c83ed94
2017-10-08T13:02:13+02:00   ====
2017-10-08T13:02:13+02:00   downloadHttp5 https://alexandre.alapetite.fr/favicon.ico
2017-10-08T13:02:13+02:00   cURL CURLOPT_RETURNTRANSFER: OK
2017-10-08T13:02:13+02:00   Favicon retrieved successfully: 04f4d560cb92b40def3c50391c83ed94
2017-10-08T13:02:13+02:00   ====
2017-10-08T13:02:13+02:00   downloadHttp6 https://alexandre.alapetite.fr/favicon.ico
2017-10-08T13:02:13+02:00   cURL CURLOPT_RETURNTRANSFER: OK
2017-10-08T13:02:13+02:00   cURL CURLOPT_FOLLOWLOCATION: OK
2017-10-08T13:02:13+02:00   cURL CURLOPT_MAXREDIRS: OK
2017-10-08T13:02:13+02:00   cURL CURLOPT_TIMEOUT: OK
2017-10-08T13:02:13+02:00   cURL CURLOPT_ENCODING: OK
2017-10-08T13:02:13+02:00   cURL CURLOPT_USERAGENT: OK
2017-10-08T13:02:13+02:00   Favicon retrieved successfully: 04f4d560cb92b40def3c50391c83ed94

OK,
Here is the log:

2017-10-08T13:11:05+02:00   ====
2017-10-08T13:11:05+02:00   downloadHttp3 https://alexandre.alapetite.fr/favicon.ico
2017-10-08T13:11:05+02:00   cURL options: OK
2017-10-08T13:11:05+02:00   Favicon retrieved successfully: 04f4d560cb92b40def3c50391c83ed94
2017-10-08T13:11:05+02:00   ====
2017-10-08T13:11:05+02:00   downloadHttp4 https://alexandre.alapetite.fr/favicon.ico
2017-10-08T13:11:05+02:00   cURL CURLOPT_RETURNTRANSFER: OK
2017-10-08T13:11:05+02:00   Favicon retrieved successfully: 04f4d560cb92b40def3c50391c83ed94
2017-10-08T13:11:05+02:00   ====
2017-10-08T13:11:05+02:00   downloadHttp5 https://alexandre.alapetite.fr/favicon.ico
2017-10-08T13:11:05+02:00   cURL CURLOPT_RETURNTRANSFER: OK
2017-10-08T13:11:05+02:00   Favicon retrieved successfully: 04f4d560cb92b40def3c50391c83ed94
2017-10-08T13:11:05+02:00   ====
2017-10-08T13:11:05+02:00   downloadHttp6 https://alexandre.alapetite.fr/favicon.ico
2017-10-08T13:11:05+02:00   cURL CURLOPT_RETURNTRANSFER: OK
2017-10-08T13:11:05+02:00   cURL CURLOPT_FOLLOWLOCATION: not OK!
2017-10-08T13:11:05+02:00   cURL CURLOPT_MAXREDIRS: OK
2017-10-08T13:11:05+02:00   cURL CURLOPT_TIMEOUT: OK
2017-10-08T13:11:05+02:00   cURL CURLOPT_ENCODING: OK
2017-10-08T13:11:05+02:00   cURL CURLOPT_USERAGENT: OK
2017-10-08T13:11:05+02:00   Favicon retrieved successfully: 04f4d560cb92b40def3c50391c83ed94

And here is what I get in the browser:

Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in /var/path_to_test_file on line 67
Done.

http://php.net/manual/en/ini.core.php#ini.open-basedir

Limit the files that can be accessed by PHP to the specified directory-tree, including the file itself. This directive is NOT affected by whether Safe Mode is turned On or Off.

I'm not really sure what CURLOPT_FOLLOWLOCATION has to do with that. Isn't that about remote following?

Here we are. Bug found :-)

Thanks for your help, very efficient!
I commented out this option in the favicon.php file and indeed I'm now seeing favicons, hooray!
Some feeds still have the default one but I guess it's because they haven't defined a favicon.
Just curious: was this option added since 1.6? Because I never had this issue before.
Thank you again,

I rewrote the favicon library in FreshRSS 1.7.0 https://github.com/FreshRSS/FreshRSS/pull/1504

OK, just for the record, I tested the favicon.php you just commited and it's fine as well.

@donlencho Could you please test that it still works for you with the CURLOPT_REDIR_PROTOCOLS option I have added? https://github.com/FreshRSS/FreshRSS/pull/1657/commits/73ccfc9f7af6067a640c5b80e172b0773e218dbc~~ No needed anymore - reverted.

Yes, working fine.
Also, finally understood the firewall thing: there seems to be a filter on the word 'curl' in a filename...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mbnoimi picture mbnoimi  ·  4Comments

Alkarex picture Alkarex  ·  5Comments

Paxistatis picture Paxistatis  ·  3Comments

javerous picture javerous  ·  5Comments

Glaived picture Glaived  ·  5Comments