How to find php executable path in windows

I'm currently developing a couple of plugins for Sublime Text 2 on OS X and I would like to make them cross platform, meaning I have to find out if and where php.exe is installed.

Right now I call /usr/bin/php in Python, which obviously works only on OS X and Linux:

phppath = '/usr/bin/php'
pluginpath = sublime.packages_path() + '/HtmlTidy/tidy.php'
retval = os.system( '%s "%s"' % ( phppath, scriptpath ) )

But on Windows, there seems to be no definitive default path for php.exe. The more I googled for it, the more possibilities showed up. So far I think I would have to check each of the following paths for existence:

c:\php\php.exe
c:\php5\php.exe
c:\windows\php.exe
c:\program files\php\php.exe
c:\wamp\bin\php\php5\php.exe
c:\xampp\php\php.exe

That's already quite a collection, but what I'm asking for is either a complete list covering all possibilities - or another way to figure it out that should be as robust as checking each possible path.

So if you have php.exe installed in some place other than these, please leave a comment with your path and I will add it to the list above.

Besides, there seems to be php.exe and php-cli.exe. I guess it would be OK to loop through each possible path. Check first for php-cli.exe, check for php.exe, and take the first match. Is that correct or is there a better practice?

How to find php executable path in windows

The default path of the Php should also be found in Windows. In Windows, there is an ini file. You can access PHP with an Apache server. The installation directory for Apaches is first searched for ini, as indicated. In case C:/program files/apache group/apache -f, c:/apache.

Table of contents
  • How Do I Find My Php Path?
  • How Do I Find Php Path In Windows?
  • Where Is Php Exe File?
  • How Do I Know If Php Is Installed On Windows?
  • How Do I Run Php On Windows 10?
  • How Set Php Executable Path In Vscode?
  • What Is Php Exe File?
  • Where Is My Php Exe File?
  • How Run Php Exe In Php?

How Do I Find My Php Path?

Windows will ask you for your php installation path. Installing PHP on Windows is simply as simple as downloading the PHP zip file and unzipping it to a local folder before you can run it via OS X’s dos window. With the following example, the install path should take place: C:/xampp/php/ in PHP.

  • Your PHP installation directory can be found on your clipboard (you can copy it).
  • You can find it by right-clicking the Start menu.
  • Click “System”
  • Click “Advanced system settings”
  • Click “Environment Variables…”
  • Your user’s preference and system’s list of selections are the options.
  • Click “Edit…”
  • Click “New”
  • Where Is Php Exe File?

    subfolder of the user’s profile directory is C:/Users/USERNAME/AppData/Local/ PHP 7. This can be the location where exe is located. Windows 10/8/7/XP commonly has file sizes ranging from 28740 to 106496 bytes, or 57%, if every occurrence takes place.

    How Do I Know If Php Is Installed On Windows?

  • Open command prompt.
  • Use cd C:/Xampp/php to find a directory.
  • Type command php -v.
  • Your PHP version will be confirmed for you.
  • How Do I Run Php On Windows 10?

  • Start by downloading the PHP files. You must install the PHP Windows application for the files.
  • You need to extract the files after you extract them.
  • Step 3: Configure php.
  • On top of that you should add C:*php to the path environment variable as an add on.
  • In step five, you configure the PHP module to work on Apache.
  • A PHP file may be used if testing is needed.
  • How Set Php Executable Path In Vscode?

  • Go To System Properties.
  • Go To Advanced Tab.
  • Click “Environment Variables”
  • Select Path.
  • You could also enter a new path pointing to a file.
  • What Is Php Exe File?

    An introduction to MySQL PHP. A legitimate file is the PHP Php Safe Command Line Interface (SDCI) called Thread PHP Safe Command Line Interface. Php Group developed this interface. PHP developers often use this file under C:/Program Files/Common Files to store their work.

    Where Is My Php Exe File?

    This example shows the PHP executable file path to be /usr/bin/php, but it then links, and it is linked to /www/server/php/73/bin/php file ( this is the real PHP executable file ). you can get a path to the current PHP executable file using whereis.

    How Run Php Exe In Php?

  • You can open a command prompt by clicking on Start, going to Run > cmd.exe, and then running.
  • You should type the full path of the PHP script (php.exe) into the context menu that appears, followed by the full path of Windows service to run it on.
  • Watch How To Find Php Installation Path In Windows 10 Video

    Where is my php path Windows?

    On Windows the default path for the php. ini file is the Windows directory. If you're using the Apache webserver, php. ini is first searched in the Apaches install directory, e.g. c:\program files\apache group\apache .

    Where is php EXE in xampp?

    On a Linux or Mac OS X system, this may be available as the file /usr/bin/php. If you've installed XAMPP, you can use the program /opt/lampp/bin/php on Linux, /Applications/xampp/xamppfiles/bin/php on Mac OS X, and C:\Program Files\xampp\php\php.exe on Windows.

    What is php EXE file?

    What is php.exe? php.exe is a legitimate file. It is also called PHP Thread Safe Command Line Interface and developed by the Php Group. Since it is very useful file for php developer and it is commonly stored in C:\Program Files\Common Files.

    Where is php EXE in Wamp?

    For WAMP installation, PHP is located in C:\wamp64\bin\php\php. X.Y.Z where X.Y.Z matches to the version of PHP that you are running. After you have entered the location of PHP, save it, then restart your command prompt. From now on, you can run PHP from the command prompt on your Windows computer.

    How add php validate executable path in Vscode?

    validate executable path vscode.
    /* File->Preferences->settings->User settings tab->extensions->from the drop down select php->on the right pane under PHP › Validate: Executable Path select edit in settings. ... .
    Then set the path as your case may be e.g for a xamp user who installed xammp on c drive you will have:.