getimagesize cpanel with php 5.5.8 - php

My VPS use PHP 5.5.8
when i test
<?php
$size = getimagesize('http://donikids.com/wp-content/uploads/2014/01/tu-dung-do-choi-tre-em-gk137.jpg');
var_dump($size);
?>
This error
Warning: getimagesize(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/donikids/public_html/test.php on line 2
Warning: getimagesize(http://donikids.com/wp-content/uploads/2014/01/tu-dung-do-choi-tre-em-gk137.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/donikids/public_html/test.php on line 2
bool(false)
You can check here
http://donikids.com/test.php
Please help me
Sorry for my english

try with this
<?php
$size = getimagesize($_SERVER['DOCUMENT_ROOT'].'/wp-content/uploads/2014/01/tu-dung-do-choi-tre-em-gk137.jpg');
var_dump($size);
?>

Related

error in file get contents and var_dump

i use this code:
<?php
$token="683911895:AAGGVHW_RdP9h4dfvXYPABJe-RGdfyj125g";
$url="https://api.telegram.org/bot" . $token . "/getupdates";
$content=file_get_contents($url);
var_dump ($content);
?>
but it have 2 errors:
1:
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: A non-recoverable error occurred during a database lookup. in C:\wamp\www\tbot.php on line 5
2:
Warning: file_get_contents(https://api.telegram.org/bot683911895:AAGGVHW_RdP9h4dfvXYPABJe-RGdfyj125g/getupdates): failed to open stream: php_network_getaddresses: getaddrinfo failed: A non-recoverable error occurred during a database lookup. in C:\wamp\www\tbot.php on line 5
and telegram is ban in my country
check php settings "allow_url_fopen = On"
check the usage here http://www.php.net/manual/en/function.file-get-contents.php
if it still will not connect then you have an issue with the URL or DNS on your server.

mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: No such host is known

I am trying to connect my local PHP program from one PC and Mysql from a server or another PC. But I got following error when I tried this
Warning: mysqli_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known. in D:\xampp\htdocs\bharat\bharat\connect.php
Warning: mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: No such host is known. in D:\xampp\htdocs\bharat\bharat\connect.php
Warning: mysqli_error() expects parameter 1 to be mysqli, string given in D:\xampp\htdocs\bharat\bharat\connect.php
<?php
$con = mysqli_connect('https://192.168.43.215', 'root', '12345678', 'bharat') or die(mysqli_error("Error connection"));
I tried to keep mysql database in remote server for data security and software in local machine. Can any one tell me the exact way. Thank you.
You don't need the https://, this would be sufficient:
<?php
$con = mysqli_connect('192.168.43.215', 'root', '12345678', 'bharat') or die(mysqli_error("Error connection"));

Is there any way to check .PEM file is Valid or not in iOS?

I have created production AdHoc .pem files. I have followed this steps:
By using This Link
I created .PEM file and i checked does this valid or not by using following command like:
$php simplepush.php
but i am getting an error like::
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Users/mac-jarc/Desktop/SimplePush/simplepush.php on line 21
Warning: stream_socket_client(): unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known) in /Users/mac-jarc/Desktop/SimplePush/simplepush.php on line 21
Failed to connect: 0 php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
But in my PHP developer said it's a .PEM file mistake . I tought it's not(Because i am very sure my .PEM file is perfect) and i suggested to him like it's a server ports issue
Can you please help me out regarding this:: How would i check does my .PEM file is valid or not.
Here is my php code:

is there any func to set extension=php_mssql.dll without editing in php.ini using functions like we used ini_set(); method

<?php
$con=mysql_connect('$url','$dbuser','$dbpass');
if(!$con){
die('cannot establish connection:'.mysql_error());
}
$db=mysql_select_db("$db");
if(!$db){
die('cannot found database:'.mysql_error());
}
?>
Giving warnings :-
Warning: mysql_connect(): php_network_getaddresses: getaddrinfo
failed: No such host is known. in D:\xampp\htdocs\connection.php on
line 3
Warning: mysql_connect(): php_network_getaddresses: getaddrinfo
failed: No such host is known. in D:\xampp\htdocs\connection.php on
line 3 cannot establish connection:php_network_getaddresses:
getaddrinfo failed: No such host is known.
Can anyone help ?
Use dl()
dl — Loads a PHP extension at runtime
as well as use extension_loaded() to check extension is loaded
For mssql - dl('php_pdo_sqlsrv_56_ts.dll');
Example
<?php
// Example loading an extension based on OS
if (!extension_loaded('sqlite')) {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
dl('php_sqlite.dll');
} else {
dl('sqlite.so');
}
}

PHP file_get_contents not working

i am having a problem with PHP file_get_contents.
$html = file_get_html($csfd_link);
Writes an error:
Warning: file_get_contents() [function.file-get-contents]:
php_network_getaddresses: getaddrinfo failed: Name or service not
known in /home/vo003500/www_root/admin/simple_html_dom.php on line 76
Warning: file_get_contents(http://www.example.com/)
[function.file-get-contents]: failed to open stream:
php_network_getaddresses: getaddrinfo failed: Name or service not
known in /home/vo003500/www_root/admin/simple_html_dom.php on line 76
I do not know what it is. The server is allow_url_fopen ON
Thanks
Edit:
Until now it worked, but the last 2 weeks not working...
It looks like your suffering from DNS (Domain Name Service) resolution error. Make sure there is a proper DNS server entry in /etc/resolv.conf.

Categories