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

  • SEARCH
  • Home
  • 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 1042609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:32:07+00:00 2026-05-16T15:32:07+00:00

On Linux $_SERVER[_] contains path to PHP interpreter executable (for example /usr/bin/php -r ‘echo

  • 0

On Linux $_SERVER["_"] contains path to PHP interpreter executable (for example /usr/bin/php -r 'echo $_SERVER["_"];' will print /usr/bin/php). On Windows XP with PHP 5.3 $_SERVER["_"] is NULL.

  • 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-05-16T15:32:08+00:00Added an answer on May 16, 2026 at 3:32 pm

    That’s nothing to do with PHP itself. It’s shell that defines that environment variable. PHP just picks it up

    For instance, see here:

    The shell sets up some default shell variables; PS2 is one of them. Other useful shell variables that are set or used in the Korn shell are:

    • _ (underscore) — When an external command is executed by the shell, this is set in the environment of the new process to the path of the executed command. In interactive use, this parameter is also set in the parent shell to the last word of the previous command.
    • …

    I think your best shot in Windows is to write an internal function. E.g.

    PHP_FUNCTION(get_php_path)
    {
        char path[MAX_PATH];
        int result;
    
        if (zend_parse_parameters_none() == FAILURE)
            return;
        
        result = GetModuleFileNameA(NULL, path, MAX_PATH);
    
        if (result == 0)
            RETURN_FALSE;
    
        if (result == MAX_PATH) {
            php_error_docref(NULL TSRMLS_CC, E_WARNING, "Path is too large");
            RETURN_FALSE;
        }
    
        RETURN_STRINGL(path, result, 1);
    }
    

    Example:

    >php -r "echo get_php_path()";
    D:\Users\Cataphract\Documents\php-trunk\Debug_TS\php.exe
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 534k
  • Answers 534k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to mark the string returned as "raw" and… May 17, 2026 at 12:47 am
  • Editorial Team
    Editorial Team added an answer As long as you're keeping the license intact (with where… May 17, 2026 at 12:47 am
  • Editorial Team
    Editorial Team added an answer There are already a number of extensions available to offer… May 17, 2026 at 12:47 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am reviewing a Linux based perl web application that contains a login handler
I'm doing IPC on Linux using boost::interprocess::shared_memory_object as per the reference (anonymous mutex example).
I have two machines I work on: Windows Client (Development Machine) Linux Web Server
I've this TcpClient code which works fine. It connects to perl server on linux
I've developed a Qt application which contains a TCP server and such. I'm now
I am using a Linux Server and am trying to install Pdftk, but I
I´am with a problem for search a file on a linux server, i try
I'm setting up a cronjob to run every 30 minutes on a Linux server.
I am trying to connect to an IBM DB2 9 database on a Linux
It works on XAMPP but not on the host that serves my website (linux

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.