Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to undefined function mime_content_type() #123

Closed
ibertrix opened this issue Oct 8, 2017 · 3 comments
Closed

Call to undefined function mime_content_type() #123

ibertrix opened this issue Oct 8, 2017 · 3 comments

Comments

@ibertrix
Copy link

ibertrix commented Oct 8, 2017

All checks work except validate-mime. I use PHP 7.0. I have googled around and apparently the function mime_content_type was deprecated and now it´s rescued in PHP 7.x. Maybe to make doctor work in all PHP versions?

These are the errors:

wp --allow-root doctor check validate-mime
Fatal error: Uncaught Error: Call to undefined function runcommand\Doctor\Checks\mime_content_type() in /root/.wp-cli/packages/vendor/wp-cli/doctor-command/inc/checks/class-validate-mime.php:33
Stack trace:
#0 /root/.wp-cli/packages/vendor/wp-cli/doctor-command/inc/class-command.php(99): runcommand\Doctor\Checks\Validate_Mime->run()
#1 phar:///usr/local/bin/wp/php/class-wp-cli.php(271): runcommand\Doctor\Command->runcommand\Doctor{closure}()
#2 phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(1060): WP_CLI::do_hook('after_wp_load')
#3 /root/.wp-cli/packages/vendor/wp-cli/doctor-command/inc/class-command.php(277): WP_CLI\Runner->load_wordpress()
#4 /root/.wp-cli/packages/vendor/wp-cli/doctor-command/inc/class-command.php(156): runcommand\Doctor\Command->load_wordpress_with_template()
#5 [internal function]: runcommand\Doctor\Command->check(Array, Array)
#6 phar:///usr/local/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php(81): call_user_func(Array, Array, Array)
#7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CL in /root/.wp-cli/packages/vendor/wp-cli/doctor-command/inc/checks/class-validate-mime.php on line 33

@danielbachhuber
Copy link
Member

All checks work except validate-mime. I use PHP 7.0. I have googled around and apparently the function mime_content_type was deprecated and now it´s rescued in PHP 7.x. Maybe to make doctor work in all PHP versions?

@ibertrix It looks like mime_content_type() is a part of the Fileinfo PHP extension. Can you make sure this is installed on your system?

@ibertrix
Copy link
Author

Thanks, that was it. I have succesfully run the validate-mime. I got a warning saying "Files detected with different MIME type". What does this exactly mean?

@danielbachhuber
Copy link
Member

I got a warning saying "Files detected with different MIME type". What does this exactly mean?

As an example, file.png that actually is a JPEG.

We'll be clarifying the error messages in #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants