In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to do rename errors in php. It is very detailed and has a certain reference value. Friends who are interested must finish it!
Print out the cause of the error.
Error_get_last () doesn't seem to return anything. Rename () returns true false instead of an exception.
If (! rename ($file- > filepath, $full_path) {$error = error_get_last (); watchdog ('name', "Failed to move the uploaded file from% source to% dest", array ('% source' = > $file- > filepath,'% dest' = > $full_path));}
Solution.
First of all, it is best to add some security checks before:
If (file_exists ($old_name) & & (! file_exists ($new_name)) | | is_writable ($new_name) {rename ($old_name, $new_name);}
Second, you can turn on error reporting:
Error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE); these are all the contents of the article "what to do with rename errors in php". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.