473,287 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

PHP Curl Not wanting to connect to localhost.

5 Nibble
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a 404 error when i try and connect. How could i fix this.
Expand|Select|Wrap|Line Numbers
  1.  $concurl = curl_init();
  2.    curl_setopt($concurl, CURLOPT_URL, "http://localhost/user-validation.php?somevalue=userid");
  3.    curl_setopt($concurl,CURLOPT_RETURNTRANSFER, true);
  4.  
  5.    $response = curl_exec($concurl);
  6.    curl_close($concurl);
  7.  
  8.       echo $response;


Thanks,
matthew
May 29 '23 #1
1 15942
Niheel
2,460 Expert Mod 2GB
Can you check to see if you have CURL enabled in your local PHP installment?

Are you using XAMP or anything similar for local development? What OS?


Niheel
Bytes
Jun 5 '23 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Raja | last post by:
Hello Im trying to catch timeouts from a socket and my code looks like try: timeoutsocket.setDefaultSocketTimeout(10) s = timeoutsocket.timeoutsocket(timeoutsocket.AF_INET,...
1
by: Pablo Gosse | last post by:
Hi folks. I'm creating a database using the following command: createdb -U pablo -W pablotest1 I'm prompted to enter the password to create the DB, and after doing so the db is created...
0
by: jsaint | last post by:
I'm using php 5.1.2 on apache 2.0.54 and am trying to use curl to connect to an ssl server. Curl works fine using http, and the command-line client works with https. But, in php, I just get error 7...
2
by: Iain Adams | last post by:
Hey I am using cURL to connect to a web service. The web service returns a result. This works most the time however some times curl doesnt return anything, no errors and no xml (what the web...
3
by: rottmanj | last post by:
I am re-writing my rets application in perl, and I have found a few modules that will help me on my way. One of them being WWW::Curl:easy. During my testing, I have tested both system curl and...
3
by: teo | last post by:
I'm developing a software (a WinApp, not a WebApp) to retrieve Date & Time from a web server, but firstly I need to to test it on my PC, with "localhost" I'm using the VB Net language (below...
2
by: qvx | last post by:
Hi, I don't have server listening on port 8084 but I can open socket to it (and to many other ports, tested for all<8000) import socket def test(port): af, socktype, proto, canonname, sa =...
5
by: FalconIA | last post by:
After I updated php from 5.3.0 to 5.3.2, mysql_connect cannot connect localhost but 127.0.0.1. It shows: Warning: mysql_connect() : A connection attempt failed because the connected party did not...
0
by: nesiar | last post by:
i am in the closing stages of an sms application that will send different sms messages to different phone numbers. I will be using an sms gateway and my research led me to use cURL to implement the...
2
by: freeseif | last post by:
Hello Every One, I have a dedicated server, and i want get my private informations from my bank. The server of my bank already have HTTPS, signed by VeriSign, Inc. RC4 128B. So i want use...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.