Plugin Contributor
Backie
(@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 http://www.catn.com 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/mydomain.com/wp-content/plugins/cdn-sync-tool/lib/Cdn/Aws.php on line 104
Fatal error: Call to undefined function mime_content_type() in /var/www/html/mydomain.com/wp-content/plugins/cdn-sync-tool/lib/Cdn/Aws.php 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
(@backie)
Can I ask what version of PHP you are using? Since that constant is predefined and should be there by default.
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:
require("/usr/share/pear/PEAR.php");
So how could I get CDN sync to work for me?
Thanks
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
(@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.
Right,
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.
Thanks.
@digitalconcept: thanks, tried your hack but it did not work.
Plugin Contributor
Backie
(@backie)
http://uk3.php.net/manual/en/function.finfo-file.php as it states under the name of the function
“(PHP >= 5.3.0, PECL fileinfo >= 0.1.0)”
those are the requirements.
Also http://uk3.php.net/mime_content_type 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.
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”