Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9226883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:56:06+00:00 2026-06-18T04:56:06+00:00

I want to have an HTTP GET request sent from PHP. Example: http://tracker.example.com?product_number=5230&price=123.52 The

  • 0

I want to have an HTTP GET request sent from PHP. Example:

http://tracker.example.com?product_number=5230&price=123.52

The idea is to do server-side web-analytics: Instead of sending tracking
information from JavaScript to a server, the server sends tracking
information directly to another server.

Requirements:

  • The request should take as little time as possible, in order to not
    noticeably delay processing of the PHP page.

  • The response from the tracker.example.com does not need to be
    checked. As examples, some possible responses from
    tracker.example.com:

    • 200: That’s fine, but no need to check that.

    • 404: Bad luck, but – again – no need to check that.

    • 301: Although a redirect would be appropriate, it would delay
      processing of the PHP page, so don’t do that.

    In short: All responses can be discarded.

Ideas for solutions:

  • In a now deleted answer, someone suggested calling command line
    curl from PHP in a shell process. This seems like a good idea,
    only that I don’t know if forking a lot of shell processes under
    heavy load is a wise thing to do.

  • I found php-ga, a package for doing server-side Google
    Analytics from PHP. On the project’s page, it is
    mentioned: “Can be configured to […] use non-blocking requests.”
    So far I haven’t found the time to investigate what method php-ga
    uses internally, but this method could be it!

In a nutshell: What is the best solution to do generic server-side
tracking/analytics from PHP.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:56:08+00:00Added an answer on June 18, 2026 at 4:56 am

    Unfortunately PHP by definition is blocking. While this holds true for the majority of functions and operations you will normally be handling, the current scenario is different.

    The process which I like to call HTTP-Ping, requires that you only touch a specific URI, forcing the specific server to boot-strap it’s internal logic. Some functions allow you to achieve something very similar to this HTTP-ping, by not waiting for a response.

    Take note that the process of pinging an url, is a two step process:

    1. Resolve the DNS
    2. Making the request

    While making the request should be rather fast once the DNS is resolved and the connection is made, there aren’t many ways of making the DNS resolve faster.

    Some ways of doing an http-ping are:

    1. cURL, by setting CONNECTION_TIMEOUT to a low value
    2. fsockopen by closing immediately after writing
    3. stream_socket_client (same as fsockopen) and also adding STREAM_CLIENT_ASYNC_CONNECT

    While both cURL and fsockopen are both blocking while the DNS is being resolved. I have noticed that fsockopen is significantly faster, even in worst case scenarios.

    stream_socket_client on the other hand should fix the problem regarding DNS resolving and should be the optimal solution in this scenario, but I have not managed to get it to work.

    One final solution is to start another thread/process that does this for you. Making a system call for this should work, but also forking the current process should do that also. Unfortunately both are not really safe in applications where you can’t control the environment on which PHP is running.

    System calls are more often than not blocked and pcntl is not enabled by default.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have my site urls look like http://example.com/place/info?var=info&morevars=ifneeded Place and info are
In a blog in Rails I want to have paths like http://mydomain.com/posts/28383/comments#21 This is
I have created a little example,please have a look, http://jsfiddle.net/bWTwL/ I want to have
Im using the jQuery SmoothDivScroll plugin. http://www.smoothdivscroll.com/ I want to have continuous scrolling, but
I have a page http://www.mysite.com/image.aspx , that I want to load and display an
I need to sent a HTTP GET Request to my site and then get
I'm trying to access the raw HTTP request sent to the server in PHP.
I have a simple problem. I want to delete all app request sent via
I have the following code which takes a normal HTTP GET Request and returns
I have this string: small: http://img.exent.com/free/frg/products/666550/player_boxshot.jpg boxshot: http://img.exent.com/free/frg/products/666550/boxshot.jpg I want to get only the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.