Я пытаюсь получить ответ Curl от внешнего сервера, однако я заметил, что не могу ни PING-сервер, о котором идет речь, ни подключиться к нему.
Я попытался отключить брандмауэр iptables, но безуспешно. Мой сервер работает за маршрутизатором Cisco Linksys WRTN310N с установленной микропрограммой DD-wrt. В котором я уже отключил брандмауэр.
Вот мои настройки сети:Ifconfig
eth0 Link encap:Ethernet HWaddr 00:26:b9:76:73:6b
inet addr:192.168.1.120 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::226:b9ff:fe76:736b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:49713 errors:0 dropped:0 overruns:0 frame:0
TX packets:30987 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:52829022 (52.8 MB) TX bytes:5438223 (5.4 MB)
Interrupt:16
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:341 errors:0 dropped:0 overruns:0 frame:0
TX packets:341 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27604 (27.6 KB) TX bytes:27604 (27.6 KB)
/etc/resolv.conf
nameserver 192.168.1.1
/etc/nsswitch.com
passwd: compat
group: compat
shadow: compat
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
/etc/host.conf
order hosts,bind
multi on
/ и т.д. / хосты
127.0.0.1 localhost
127.0.0.1 callcenter
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
/ и т.д. / сеть / интерфейсы
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.120
netmask 255.255.255.0
network 192.168.1.1
broadcast 192.168.1.255
gateway 192.168.1.1
URL, к которому я пытаюсь подключиться:https://www.veripayment.com/integration/index.php Когда я пингую его на терминале, вот что я получаю
daniel@callcenter:~$ ping https://www.veripayment.com/integration/index.php
ping: unknown host https://www.veripayment.com/integration/index.php
daniel@callcenter:~$ ping www.veripayment.com
PING www.veripayment.com (69.172.200.5) 56(84) bytes of data.
--- www.veripayment.com ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1007ms
PHP функция в коде
public function authorizePayment(){
//---------------------------------------------------
// Authorize a payment
//---------------------------------------------------
// Get variables from POST array
$post_str = "action=payment&business=" .urlencode($this->input->post('business'))
."&vericode=" .urlencode($this->input->post('vericode'))
."&item_name=" .urlencode($this->input->post('item_name'))
."&item_code=" .urlencode($this->input->post('item_code'))
."&quantity=" .urlencode($this->input->post('quantity'))
."&amount=" .urlencode($this->input->post('amount'))
."&cc_type=" .urlencode($this->input->post('cc_type'))
."&cc_number=" .urlencode($this->input->post('cc_number'))
."&cc_expdate=" .urlencode($this->input->post('cc_expdate_year')).urlencode($this->input->post('cc_expdate_month'))
."&cc_security_code=" .urlencode($this->input->post('cc_security_code'))
."&shipment=" .urlencode($this->input->post('shipment'))
."&first_name=" .urlencode($this->input->post('first_name'))
."&last_name=" .urlencode($this->input->post('last_name'))
."&address=" .urlencode($this->input->post('address'))
."&city=" .urlencode($this->input->post('city'))
."&state_or_province=" .urlencode($this->input->post('state_or_province'))
."&zip_or_postal_code=" .urlencode($this->input->post('zip_or_postal_code'))
."&country=" .urlencode($this->input->post('country'))
."&shipping_address=" .urlencode($this->input->post('shipping_address'))
."&shipping_city=" .urlencode($this->input->post('shipping_city'))
."&shipping_state_or_province=" .urlencode($this->input->post('shipping_state_or_province'))
."&shipping_zip_or_postal_code=".urlencode($this->input->post('shipping_zip_or_postal_code'))
."&shipping_country=" .urlencode($this->input->post('shipping_country'))
."&phone=" .urlencode($this->input->post('phone'))
."&email=" .urlencode($this->input->post('email'))
."&ip_address=" .urlencode($this->input->post('ip_address'))
."&website_unique_id=" .urlencode($this->input->post('website_unique_id'));
// Send URL string via CURL
$backendUrl = "https://www.veripayment.com/integration/index.php";
$this->curl->create($backendUrl);
$this->curl->post($post_str);
$return = $this->curl->execute();
$result = array();
// Explode array where blanks are found
$resparray = explode(' ', $return);
if ($resparray)
{
// save results into an array
foreach ($resparray as $resp) {
$keyvalue = explode('=', $resp);
if(isset($keyvalue[1])){
$result[$keyvalue[0]] = str_replace('"', '', $keyvalue[1]);
}
}
}
return $result;
}
Это получает пустой массив результатов. Однако эта функция хорошо работает на предыдущем сервере, где ранее размещался скрипт. Никаких модификаций где бы то ни было сделано
Заранее спасибо