WordPress Error Fix: Unable to Parse URL
Published Tuesday, July 29, 2008 @ 9:01 am • 0 Responses
Note: This information is intended primarily for WordPress versions previous to 2.3, but may be applicable in other versions as well.
For those of you running an older version of WordPress that is generating errors such as:
Warning: parse_url(http://) [function.parse-url]: Unable to parse url in /home/path/to/public_html/wordpress/wp-includes/functions.php on line 1067
Warning: parse_url(http://) [function.parse-url]: Unable to parse url in /home/path/to/public_html/wordpress/wp-includes/functions.php on line 1067
Warning: parse_url(http://) [function.parse-url]: Unable to parse url in /home/path/to/public_html/wordpress/wp-includes/functions.php on line 1067
Warning: parse_url(http://) [function.parse-url]: Unable to parse url in /home/path/to/public_html/wordpress/wp-includes/functions.php on line 1067
Warning: parse_url(http://) [function.parse-url]: Unable to parse url in /home/path/to/public_html/wordpress/wp-includes/functions.php on line 1067
Warning: parse_url(http://) [function.parse-url]: Unable to parse url in /home/path/to/public_html/wordpress/wp-includes/functions.php on line 1067
Warning: parse_url(http://) [function.parse-url]: Unable to parse url in /home/path/to/public_html/wordpress/wp-includes/functions.php on line 1067
Warning: parse_url(http://) [function.parse-url]: Unable to parse url in /home/path/to/public_html/wordpress/wp-includes/functions.php on line 1067
You can easily resolve the issue by suppressing these errors, which are automatically generated whenever the parse_url() function tries to parse an empty value for the URL. To silence the errors, open the file wp-includes/functions.php and locate the following code (around line #1067):
$parsed = parse_url('http://' . $value['url']);
In that line, place an “@” symbol before the “parse_url” like so:
$parsed = @parse_url('http://' . $value['url']);
And that should do it. The “@” symbol works to suppress any errors generated by the parse_url() function. So say goodbye to those relentless PHP errors. Additionally, you might want to make a note of the change somewhere just in case you decide you upgrade or reinstall WordPress. Cheers!
About this article
Related articles
- WordPress Error Fix(?): Increase PHP Memory for cache.php
- Advanced PHP Error Handling via htaccess
- How to Enable PHP Error Logging via htaccess
- Perishable Press Unresolved Error Log
- Advanced PHP Error Handling via PHP
- Title Attributes for WordPress Post Navigation
- Use PHP to Create Symbolic Links without Shell Access
← Previous post • Next post →
« Open Call for Guest Posts at Perishable Press • Choosing the Best Title Separators »