• Resolved victormich12

    (@victormich12)


    Hello,

    I get PHP Fatal error when I want to upload a new file.

    I get this error message (in french) : Le serveur ne peut pas traiter l’image. Cela peut se produire si le serveur est occupé ou ne dispose pas de suffisamment de ressources pour terminer la tache. Téléverser une image plus petite peut aider. La taille maximale suggérée est de 2560 pixels.

    And in my log, I get this:

    [18-Mar-2024 14:11:15 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mime_content_type() in /home/exnqefu/public_html/wp-content/plugins/media-file-renamer/classes/core.php:335
    Stack trace: 0 /home/exnqefu/public_html/wp-includes/class-wp-hook.php(324): Meow_MFRH_Core->on_upload_hook_prefilter(Array) 1 /home/exnqefu/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) 2 /home/exnqefu/public_html/wp-admin/includes/file.php(833): apply_filters(‘wp_handle_uploa…’, Array) 3 /home/exnqefu/public_html/wp-admin/includes/file.php(1105): _wp_handle_upload(Array, Array, ‘2024-03-18 15:1…’, ‘wp_handle_uploa…’) 4 /home/exnqefu/public_html/wp-admin/includes/media.php(306): wp_handle_upload(Array, Array, ‘2024-03-18 15:1…’) 5 /home/exnqefu/public_html/wp-admin/async-upload.php(114): media_handle_upload(‘async-upload’, 0) 6 {main}

    thrown in /home/exnqefu/public_html/wp-content/plugins/media-file-renamer/classes/core.php on line 335
    
    
    It's only happen when Media File Renamer is activated. When I desactivated the plugin, everything works.
    
    I tried roll-back the plugin to a previous version but not working.
    
    Thanks for your help,
    
    Victor
Viewing 2 replies - 1 through 2 (of 2 total)
  • Gal Baras

    (@galbaras)

    mime_content_type() is a PHP function, not part of WordPress, so your PHP setup may be missing a module (likely fileinfo).

    For reference, here’s what I use on all my sites, based on the recommended server configuration for WordPress (not that I’m on PHP 8.2):

    • bcmath
    • curl
    • dom
    • exif
    • fileinfo
    • filter
    • gd
    • hash
    • iconv
    • imagick
    • intl
    • json
    • mbstring
    • mysqli
    • mysqlnd
    • openssl
    • pcre
    • SimpleXML
    • sodium
    • timezonedb
    • xml
    • xmlreader
    • xmlwriter
    • zip
    • Zend OPcache
    Plugin Support Val Meow

    (@valwa)

    Hey @victormich12 ! ??

    Your PHP environment might be missing a function called “mime_content_type”. The next version of the plugin will handle this scenario, so you don’t have to worry about it anymore. Thanks for reporting!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Fatal error when Media uploading’ is closed to new replies.