Forums | Mahara Community

Support /
Upgrading to Mahara 1.2.5 - mime_magic extension problem


anonymous profile picture
Account deleted
Posts: 23

08 July 2010, 2:26

Hi all,

I'm using PHP 5.2.10 in Centos 5. When I upgraded my Mahara from 1.2.4 to 1.2.5, I have a mime_magic extention problem. It said this extension is not enabled.

I tried to use: yum install php*mime_magic*,

but it seems that there is no mime_magic install packet.

 

The default configugartion of PHP is "--without-mime-magic". I cann't change this configuaration, except  i need to recompile PHP.

I did install Fileinfo extension successfully, but it is no help.

I added this to php.ini

mime_magic.magicfile = "/usr/share/file/magic.mime"

mime_magic.debug = Off

extension=fileinfo.so

but it doesn't work.
Is there someone has the same problem or help me to enable the mime_magic extension for PHP 5.2.10 in Centos?
Many thanks.

 

Iñaki Arenaza's profile picture
Posts: 253

10 July 2010, 16:53

Sorry to ask the obvious but, did you restart the apache service after installing and configuring the Fileinfo extension?

Saludos.
Iñaki.

anonymous profile picture
Account deleted
Posts: 23

11 July 2010, 1:26

Hi Iñaki,

I did restart the Apache. The Fileinfo extension is running fine. the problem is that i couldn't enable the mime_magic extension and Mahara always asks mimi_magic extension. I'm trying to enable this extension but it seems that it went no where. :(

 

Thanks Iñaki

 

anonymous profile picture
Account deleted
Posts: 5

10 July 2010, 20:22

Hi ,

mime magic seems to be installed, but the problem seems to be related to
mahara not finding the function mime_content_type

I see that the VPS has installed php from:
/etc/yum.repos.d/CentOS-Testing.repo

I had to revert the php version to the centos stable 5.1.6 to install the fileinfo extension:

# apt-get install php-common=5.1.6-27.el5

# apt-get install php php-cli php-devel php-gd php-mcrypt php-mysql php-pdo php-pear php-xml

I installed the following and seem to sol

# apt-get install php-pecl-Fileinfo

I installed the json extension and reverted with pecl:

# pecl install json

# echo "extension=json.so" >/etc/php.d/json.ini

# /etc/init.d/httpd restart

I tried to install the pecl fileinfo extension several times with the version of centos testing, but it didn't seem to work, that is why I had to downgrade.

This seemed to wwork for my installation.  Good luck.

 

anonymous profile picture
Account deleted
Posts: 23

11 July 2010, 1:30

Hi

i did the similar thing. I reinstalled the php version 5.1.6. in this version i got the mime_magic extension anabled. But when i upgraded to PHP 5.2.x the mime_magicextension is disabled. it seems that the Repo that i use to install PHP 5.2.x wasn't compiled with mime_magic exension.

Thanks. Hope anyone can help me. :(

 

anonymous profile picture
Account deleted
Posts: 2

11 July 2010, 16:17

Hi Guys:

I know some of your reverted to 5.1.6, however, this is not something that I want to do. I have installed and loaded pecl-fileinfo. However, I'm having no luck.

Please take a look at http://3639990861/  ( I used URL obfuscator, it redirect to a phpinfo page).

Thanks for your help in advance.

Regards,

Levis Bakalinsky

anonymous profile picture
Account deleted
Posts: 808

11 July 2010, 17:33

Looks like using mime_magic & mime_content_type was not such an awesome idea.

Most of the time Mahara will work fine without it, so you can just suppress the warning message by setting

$cfg->log_environ_targets = LOG_TARGET_ERRORLOG;

in config.php.

If you are running mahara behind a reverse proxy you may find that file types are not detected properly; see https://bugs.launchpad.net/mahara/+bug/591373.

I guess we'll need to provide an alternative to mime_content_type using Fileinfo, and/or make guesses using the filename extension.

anonymous profile picture
Account deleted
Posts: 2

11 July 2010, 17:42

Richard, what do you mean by "Most of the time Mahara will work fine without it....?" Could you possible tell me some of the glitches that I might encounter?

anonymous profile picture
Account deleted
Posts: 808

11 July 2010, 20:12

When you upload a file to Mahara, it believes what the browser tells it about the file's mimetype.  Sometimes Mahara doesn't get a mimetype from the browser, only 'application/octet-stream'.  I don't know when this happens exactly, but it sounds from that bug report as if running Mahara behind a reverse proxy is one cause.

When the mimetype is presented to Mahara as application/octet-stream, it runs mime_content_type to guess a more informative mimetype.

If that function isn't available, then certain files won't show up where they should, e.g. some html files may not be available to choose in the html blocktype, the 'unzip' link may not appear for some .zip files, etc.

 

anonymous profile picture
Account deleted
Posts: 23

12 July 2010, 1:48

Thanks all,

 

Hope this will be changed in next version of Mahara

13 results