php_network_getaddresses: getaddrinfo failed: No such host is known.
Tech-Today

php_network_getaddresses: getaddrinfo failed: No such host is known.


Wondering how to disable the above error?

Even if you set in your php.ini:

display_errors = Off

Errors will still pop out.

Solution:
Just add @ at the beginning of the function:


$handle = @fopen($obj, "r");


@, suppress the warnings produced

Php documentation says:
[phpdoc]
Error Control Operators
PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.

If the track_errors feature is enabled, any error message generated by the expression will be saved in the variable $php_errormsg. This variable will be overwritten on each error, so check early if you want to use it.
[/phpdoc]




- Web Development
WordpressConfigure Custom Wordpress PermalinkZencartHow to add a customize product admin fields in zencart by editing/adding extra codesJoomlaHow to install/setup/configure joomla to run in a xampp setup. This avoids the technical detail of manually installing...

- Validation-summary-errors Div Showing Even If There Is No Error Binded To A Property
I'm working on a change password form when I encountered this strange behavior from mvc3. I created a simple form and change password model with 3 fields (old, new, confirm password). Then I extended ValidationAttribute to validate the password's...

- Gsmcomm Message Received 321 Occurred
Recently I've encountered this error while developing a gsmcomm powered device up couple with 500 error. To know what these errors mean, you can refer to: http://www.developershome.com/sms/resultCodes2.asp#16.2.1.1.Table of +CMS Error Codes and Their...

- Rijndael Invalid Length For A Base-64 Char Array
I have a requirement to send a variable from a link to a page. But the variable should be encrypted. And md5 will not work because I'm using entity framework and it doesn't recognized the md5 function. So I implement encryption using Rijndael....

- Make_sock: Could Not Bind To Address 0.0.0.0:80
I am developing a web application and is testing it on my localhost, when suddenly the page failed to load. No error, no message. So I went to control panel -> Administrative Tools -> Event Viewer -> application and found 2 error entries related to Apache...



Tech-Today








.