MRatWork Forum by Mustafa Ramadhan
Sawo Project - Kloxo-MR Discussions => Kloxo-MR Technical Helps => Topic started by: jtaco263 on 2017-05-13, 07:52:03
-
hey im trying to make a curl request to cloudflare but i tried from terminal}
wget google.com
and this is the result:
[root@sv1 ~]# wget google.com
--2017-05-13 01:54:05-- http://google.com/
Resolving google.com... failed: Temporary failure in name resolution.
wget: unable to resolve host address `google.com'
my sysinfo:
A. Control Panel:
- Kloxo-MR: 7.0.0.c-2017042302
- Web: hiawatha-10.5.0-f.2.mr.el6.x86_64
- PHP: php54s-5.4.45-1.ius.centos6 (fpm mode)
B. Plateform:
- OS: CentOS release 6.9 (Final) x86_64
- Hostname: sv1.dattasolutions.com.mx
C. Services:
1. MySQL: MariaDB-server-10.0.30-1.el6.x86_64
2. PHP:
- Installed:
- Branch: php54-cli-5.4.45-1.ius.centos6.x86_64
- Multiple:
* php53m-5.3.29-1.ius.centos6
* php54m-5.4.45-1.ius.centos6
* php55m-5.5.38-1.ius.centos6
- Used: --PHP Branch--
- Multiple: enable
3. Web Used: apache
- Hiawatha: hiawatha-10.5.0-f.2.mr.el6.x86_64
- Lighttpd: lighttpd-1.4.45-1.el6.x86_64
- Nginx: nginx-1.12.0-1.el6.ngx.x86_64
- Apache: httpd-2.2.31-1.mr.el6.x86_64
- PHP Type: php-fpm_worker
- Secondary PHP: on
4. WebCache: none
- ATS: --uninstalled--
- Squid: --uninstalled--
- Varnish: --uninstalled--
5. Dns: bind
- Bind: bind-9.9.9-1.mr.el6.x86_64
- DJBDns: djbdns-1.05-17.4.mr.el6.x86_64
- NSD: nsd-4.1.14-1.el6.x86_64
- PowerDNS: pdns-4.0.3-1.el6.MIND.x86_64
- Yadifa: yadifa-2.2.3-1.mr.el6.x86_64
6. Mail: qmail-toaster-1.03-1.3.56.mr.el6.x86_64
- pop3/imap4: none
- smtp: none
- spam: bogofilter-1.2.4-1.el6.x86_64
7. FTP: pure-ftpd
- pure-ftpd: pure-ftpd-1.0.37-1.mr.el6.x86_64
8. Stats: awstats
- awstats: kloxomr-stats-awstats-7.5-1.mr.noarch
D. Memory:
total used free shared buffers cached
Mem: 6144 532 5611 4 0 237
-/+ buffers/cache: 295 5848
Swap: 6144 0 6144
E. Disk Space:
Filesystem Size Used Avail Use% Mounted on
/dev/ploop29144p1 148G 11G 130G 8% /
*** Process Time: 00:00:00:47.47104 (dd:hh:mm:ss:xxxxxx) ***
* Note: run 'sh /script/sysinfo -y' if you want run 'fix-service-list' also
(importance after Kloxo-MR update)
-
Inform here 'cat /etc/resolv.conf; traceroute google.com'
-
[root@sv1 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search dattasolutions.com.mx
# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
[root@sv1 ~]# traceroute google.com
-bash: traceroute: command not found
[root@sv1 ~]#
-
literal with every domain throws the same error
-
Try change content of /etc/resolv.conf to:
nameserver 8.8.8.8
nameserver 8.8.4.4
-
that worked but its gonna work with the sites?
in curl i have this error:
Couldn't resolve host 'api.cloudflare.com'
but i did ping and it worked this isd the code im using
function puto(){
$url = 'https://api.cloudflare.com/client/v4/zones/fffcc847cd955d4d7e8afac10ee59b84/dns_records/638bd4ca58aea88a232b0658ada71da3';
$dato = array('type' => 'A','name' => 'remote.dattasolutions.com.mx','content' => get_ip());
$request = json_encode($dato);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS,$request);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','X-Auth-Email: xxxx@gmail.com','X-Auth-Key: 7ffffgghhgga77e428df2d834ea3f1147e346572ad'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$response = curl_exec($ch);
if (curl_errno($ch))
{
print curl_error($ch);
exit();
}else{
echo 'yes';
echo '<br>';
curl_close($ch);
echo $response;
}
}
-
and its weird because i have a desktop app which uses curl to upload images to my server and its working
-
i did ping to google and found out this:
64 bytes from iad23s58-in-f14.1e100.net (172.217.7.238): icmp_seq=19 ttl=53 time=85.1 ms
what that means
-
i did ping to google and found out this:
64 bytes from iad23s58-in-f14.1e100.net (172.217.7.238): icmp_seq=19 ttl=53 time=85.1 ms
what that means
Google use multiple IP (redundance -?) for their website. It's normal.
-
what about curl? is not making connections
-
Try add:
error_reporting(E_ALL);
ini_set('display_errors', 1);
under '<?php' in your php file.
In my test, no declare for get_ip() function.
-
So, I change the code to:
function puto(){
$url = 'https://api.cloudflare.com/client/v4/zones/fffcc847cd955d4d7e8afac10ee59b84/dns_records/638bd4ca58aea88a232b0658ada71da3';
$dato = array('type' => 'A','name' => 'remote.dattasolutions.com.mx','content' => gethostbyname('remote.dattasolutions.com.mx'));
$request = json_encode($dato);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS,$request);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','X-Auth-Email: xxxx@gmail.com','X-Auth-Key: 7ffffgghhgga77e428df2d834ea3f1147e346572ad'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$response = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
exit();
} else{
echo 'yes';
echo '<br>';
curl_close($ch);
echo $response;
}
}
-
Couldn't resolve host 'api.cloudflare.com'
-
this is the answer
Couldn't resolve host 'api.cloudflare.com'
same with google.com
curl is not making connections with any website
-
the php curl is not working properly
it not resolve hosts how do i solve this?
-
Make sure curl not include in 'disable functions' in 'php configure'.
-
the php curl is not working properly
it not resolve hosts how do i solve this?
Inform here 'yum list|grep curl'.
-
i tried changing php type from php-fpm worker to event then restarted services php and httpd and now it works but now i have another issue ioncube has desactivated how to reactivate it? php version is 5.4
-
the php curl is not working properly
it not resolve hosts how do i solve this?
Inform here 'yum list|grep curl'.
[root@sv1 ~]# yum list|grep curl
curl.x86_64 7.19.7-53.el6_9 @updates
libcurl.x86_64 7.19.7-53.el6_9 @updates
libcurl-devel.x86_64 7.19.7-53.el6_9 @updates
python-pycurl.x86_64 7.19.0-9.el6 @base
asterisk-curl.x86_64 1.8.32.3-2.el6 epel
curlftpfs.x86_64 0.9.2-14.el6 epel
curlpp.i686 0.7.3-5.el6 epel
curlpp.x86_64 0.7.3-5.el6 epel
curlpp-devel.i686 0.7.3-5.el6 epel
curlpp-devel.x86_64 0.7.3-5.el6 epel
libcurl.i686 7.19.7-53.el6_9 updates
libcurl-devel.i686 7.19.7-53.el6_9 updates
ocaml-curl.x86_64 0.5.3-21.el6 epel
ocaml-curl-devel.i686 0.5.3-21.el6 epel
ocaml-curl-devel.x86_64 0.5.3-21.el6 epel
python34-pycurl.x86_64 7.43.0-5.el6 epel
uwsgi-alarm-curl.x86_64 2.0.14-11.el6 epel
uwsgi-plugin-curl-cron.x86_64 2.0.14-11.el6 epel
btw this is the message of ioncube
[root@sv1 ~]# service php-fpm restart
Stopping php-fpm (PHP Used): [ OK ]
Starting php-fpm (PHP Used): The ionCube PHP Loader is disabled because of startup problems.
-
Also 'yum list installed|grep php'.
-
Also 'yum list installed|grep php'.
[root@sv1 ~]# yum list installed|grep php
kloxomr7-thirdparty-phpmyadmin.noarch
mod_suphp.x86_64 0.7.2-3.mr.el6 @mratwork-release-version-arch
php54.x86_64 5.4.45-1.ius.centos6 @mratwork-ius-archive
php54-cli.x86_64 5.4.45-1.ius.centos6 @mratwork-ius-archive
php54-common.x86_64 5.4.45-1.ius.centos6 @mratwork-ius-archive
php54-fpm.x86_64 5.4.45-1.ius.centos6 @mratwork-ius-archive
php54-ioncube-loader.x86_64 5.0.18-1.ius.centos6 @mratwork-ius-archive
php54-mbstring.x86_64 5.4.45-1.ius.centos6 @mratwork-ius-archive
php54-mysql.x86_64 5.4.45-1.ius.centos6 @mratwork-ius-archive
php54-pdo.x86_64 5.4.45-1.ius.centos6 @mratwork-ius-archive
php54-process.x86_64 5.4.45-1.ius.centos6 @mratwork-ius-archive
php54-xml.x86_64 5.4.45-1.ius.centos6 @mratwork-ius-archive
-
Try using 'php56m' for 'php used' under 'webserver configure'.
-
Inform here 'cat /etc/php.d/*ioncube*.ini'
-
Inform here 'cat /etc/php.d/*ioncube*.ini'
zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_5.4.so
; Configured for PHP
zend_extension=/usr/lib64/php/modules/ioncube_loader_lin_5.4.so
; For threaded Apache/PHP Implementations comment out the above
; and un-comment the following:
;
; zend_extension=/usr/lib64/php/modules/ioncube_loader_lin_5.4_ts.so
;
-
Remove 'zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_5.4.so' (first line) in .ini file and then run 'sh /script/restart-web'.