Support » Plugin: CDN Sync Tool » [Plugin: CDN Sync Tool] Fatal error: … Aws.php on line 110

  • I have WP 3.0.4 with WP Super Cache and I try use CDN.
    I installed CDN Sync Tool v. 1.0 but i think I make something wrong.

    I would use “Amazon S3/CloudFront”
    My configuration seting (maybe not exactly :P)

    Anti-Hotlinking: No

    AWS Access Key: key_from_my_amazon_account
    AWS Secret Key: key_from_my_amazon_account
    AWS Bucket:
    GZIP Compression: Yes

    When I click buton “Checki Details” i have message “Details aren’t valid”

    I try ignore this message and I click Sync Files.

    And i see this error message:
    Fatal error: Call to undefined function mime_content_type() in /var/www/html/ on line 110

    What I’m doing wrong?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor Backie


    The problem is your PHP doesn’t have mime_content_type or finfo which is required. Ask your host provider to install one of those functionality or if they cannot move hosts.

    I can suggest the plugin has been fully tested on the CatN vCluster.

    I can’t change server, but i can configure it.

    Thx for response, i try look this setings 😀

    Ok i checked my server and install php-pecl-Fileinfo.x86_64 and now i have next warning 😀

    Warning: finfo_open() expects parameter 1 to be long, string given in /var/www/html/ on line 104
    Fatal error: Call to undefined function mime_content_type() in /var/www/html/ on line 110

    Then i comment string FILEINFO_MIME_TYPE and his works

    $finfo = function_exists('finfo_open') ? finfo_open(/*FILEINFO_MIME_TYPE*/) : false;

    I don’t know why thats don’t working before, but know i see all my files on amazon buckets.

    Now I can test this plugin 😀

    Plugin Contributor Backie


    Can I ask what version of PHP you are using? Since that constant is predefined and should be there by default.

    I use PHP Version 5.2.6

    I am getting the same error.
    Contacted my hosting provider and they told me that mime_content_type() is deprecated but that fileinfo is available in PEAR and that I could use it like this:


    So how could I get CDN sync to work for me?


    In file cdn-sync-tool/lib/Cdn/Aws.php I find line $finfo = function_exists('finfo_open') ? finfo_open(FILEINFO_MIME_TYPE) : false; and then I use comment marks /* */ on FILEINFO_MIME_TYPE.

    $finfo = function_exists('finfo_open') ? finfo_open(/*FILEINFO_MIME_TYPE*/) : false;

    And this plugin work, but if you upgrade this plugin you must check that.

    Plugin Contributor Backie


    Well, you’re hosting provider is correct that mime_content_type() is deprecated, however not having it due to that reason is silly since it’s deprecated and not just removed for a reason. Many items of code require it.

    fileinfo is not in PEAR it is in pecl, which means they would need to install it. However the plugin is designed for PHP 5.3 which has fileinfo installed by default and requires constants that are found in php 5.3 but aren’t defined in the pecl extension.

    You should alert your hoster that not having functions because they have been deprecated is silly as functions are undeprecated. It’s even worse that they don’t have the deprecated function because it’s deprecated but haven’t upgraded their PHP install to have the functionality which it’s been deprecated for.

    You should either upgrade to hosters where people use common sense or get your current host to set up their PHP install is a responsible way.

    I asked the provider about it and they insist fileinfo *is* avavailable in PEAR. There is no way for me to check if this is correct nor would I know how to use this information to get this plugin working so I am leaving it for now. I am on PHP 5.2.9 BTW.

    CDN sync seems like a really clever and usefull addition to supercache, but it is not so critical that I think it is worth switching hosts. (just did that). Some of the things the plugin does, like combining and compressing CSS files, moving JS to the footer and hosting static files on a CDN I can do myself so I will have to do that.


    @digitalconcept: thanks, tried your hack but it did not work.

    Plugin Contributor Backie

    (@backie) as it states under the name of the function

    “(PHP >= 5.3.0, PECL fileinfo >= 0.1.0)”

    those are the requirements.

    Also there is a snippet of code there you could add into your functions.php file or somewhere to reproduce the mime_content_type.

    I would also check and see if your host is running a 32bit server as it has a DoS flaw if it is. There are several other security updates. Personally if I was you I would move for the simple fact they seem to be a bunch of cowboys. There are plenty of hosters that would give you accurate support advise as well as have their PHP configured in a responsible way.

    turn off gzip.

    Hi all,
    Help when i want to sync files i have this error :
    “Fatal error: Call to undefined function mime_content_type() in /homez.406/unteleph/www/wp-content/plugins/cdn-sync-tool/lib/Cdn/Aws.php on line 112”

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: CDN Sync Tool] Fatal error: … Aws.php on line 110’ is closed to new replies.