Enable PHP File Info Extension - Runtime

Asked

Viewed 1,449 times

1

I’m using a library called Intervention/Image in Laravel 4.2. On a given page I use this library to crop images, but it’s not doing this because it requires you to enable or install this extension.

No localhost works, no server.

Foto do Erro

But I don’t have access to the PHP.INI server.

You can enable this DLL in real time ?

  • Where is your server? you can create a php.ini at the root to import only that dll usually hosting providers allow this type of action.

  • I just create a file php.ini and add that line: extension=php_fileinfo.dll ?

  • You have to put the absolute path... it will probably be /home/seuusuario/public_html/file.dll and php.ini is in the public_html folder, but that would be in linux and the extension type would be ". so" and not ". dll". if you could let me know what type of hosting you have would be good. Example could be by dashboard, it’s Plesk or Cpanel ?

  • cPanel. It’s supposed to be Linux. I don’t have access.

  • Solved. I ran behind the server. No way. Enabled the DLL.

1 answer

4


At runtime to enable an extension you must use dl:

dl('/path/fileinfo.so');

But I’m almost sure this will not work due to users' permission level.

In accordance with @bfavaretto - Heed: The function dl was removed in some Sapis in PHP 5.3.

You can try using the .htaccess and add this to the archive (I’ve never used this):

<IfModule mod_php5.c>
php_extension fileinfo.so
</IfModule>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.