dpowt82802 2018-08-20 04:14
浏览 61
已采纳

经常使用的术语“PHP二进制”实际上意味着什么?

I'm using Windows 10 Home Single Language 64-bit Operating System on my laptop.

I've installed the latest version of XAMPP on my laptop.

This has installed PHP 7.2.8 and Apache/2.4.34 (Win32) OpenSSL/1.1.0h PHP/7.2.8 on my laptop.

I come across following sentence from PHP Manual Page :

PHP can be used on all major operating systems, including Linux, many Unix variants (including HP-UX, Solaris and OpenBSD), Microsoft Windows, macOS, RISC OS, and probably others. PHP also has support for most of the web servers today. This includes Apache, IIS, and many others. And this includes any web server that can utilize the FastCGI PHP binary, like lighttpd and nginx.

From the above text I didn't get the exact meaning of the term "PHP binary". This peculiar term is used very frequently at many places in the PHP Manual but nowhere the actual meaning of "PHP binary" has been given.

I googled it for the meaning and I come to know about the 'predefined constant' PHP_BINARY.

So, I tried to execute the below code in hope to clear my doubt over the actual meaning of the frequently used term "PHP binary" and checked the output in my web browser:

<?php
  echo PHP_BINARY;
?>

Surprisingly, I got the below output :

C:\xampp\apache\bin\httpd.exe

I got surprised to see this output because in output I got complete address of the Apache file httpd.exe. I was expecting to get something about PHP but I got Apache file's address. Why so?

So, what does ultimately mean is I still don't understand what does actually mean by the frequently used term "PHP binary"?

I still don't have any idea about what does actually mean by the very frequently used term "PHP binary"?

Someone, please clear my doubt about the frequently used term "PHP binary" in an easy to understand, simple and lucid language.

I'm waiting for your help.

  • 写回答

2条回答 默认 最新

  • dongmi19720408 2018-08-20 06:40
    关注

    The compiled version of any program is commonly referred to as it's "binary".

    PHP has multiple binaries for multiple purposes.

    • php.exe is used to run scripts locally in your Command Prompt;

    • php-cgi.exe is compliant with FastCGI protocol;

    • php7apache2_4.dll is PHP wrapped as an Apache 2.4 module;

    • And a few others too.

    In this case the docs are referring to php-cgi.exe

    The constant PHP_BINARY contains the path of the binary where PHP is currently executing from. Since XAMPP uses Apache, and Apache is most likely using PHP in it's Apache module form, it makes sense that httpd.exe is recognized as the binary, since it is loading php7apache2_4.dll.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 求给定范围的全体素数p的(p-2)的连乘积
  • ¥15 VFP如何使用阿里TTS实现文字转语音?
  • ¥100 需要跳转番茄畅听app的adb命令
  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页