php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #61044 invalid PHP_BINDIR
Submitted: 2012-02-10 13:42 UTC Modified: 2021-02-12 13:12 UTC
Votes:5
Avg. Score:4.4 ± 0.8
Reproduced:5 of 5 (100.0%)
Same Version:0 (0.0%)
Same OS:4 (80.0%)
From: bugzilla33 at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 5.4.0RC7 OS: win 7
Private report: No CVE-ID: None
 [2012-02-10 13:42 UTC] bugzilla33 at gmail dot com
Description:
------------
Install php in folder c:\Php5
As module apache

Test script:
---------------
<?php
 print(PHP_BINDIR);
 phpinfo();
?>

Expected result:
----------------
c:\Php5

Actual result:
--------------
c:\Php

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-10 18:05 UTC] anon at anon dot anon
He's right. This seems to be totally broken on Windows:

C:\>server\php\php.exe --version
PHP 5.3.2 (cli) (built: Mar  3 2010 19:40:13)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans

C:\>server\php\php.exe -r "echo PHP_BINDIR";
C:\php5
 [2012-02-10 22:19 UTC] johannes@php.net
This is defined while compiling PHP (prefix-option from compile.js), the way to fix this would be to do some run-time detection, not sure whether there's a proper way.
 [2012-02-10 22:19 UTC] johannes@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: pajoye
 [2012-02-11 08:30 UTC] rk at srsbiz dot pl
It is not only Windows problem:

root@core /# /root/src/php5.4-201202102030/sapi/cli/php -r 'echo PHP_BINDIR . PHP_EOL;';
/usr/local/php54/bin
root@core /#

It always point to directory provided in --prefix at compile time.
 [2012-02-11 11:10 UTC] johannes@php.net
rk, that is correct, but on non-Windows you usually don't relocate the installation. Either you install using your package manager or by compiling yourself with a proper prefix, everything else is unsupported. On Windows we have the installer (which defaults to c:\program files\php (system dependent)) and the zip where people almost certainly won't use c:\php
 [2012-07-24 17:25 UTC] martin dot leucht at gmail dot com
Just to mention: On my configuration (PHP 5.4.4, Win 7) at least the value for 
PHP_BINARY is correct. Maybe this helps to create a work-around.
 [2017-10-24 07:35 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: pajoye +Assigned To:
 [2021-02-12 13:12 UTC] cmb@php.net
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem -Assigned To: +Assigned To: cmb
 [2021-02-12 13:12 UTC] cmb@php.net
At this point in time, I don't think it would be reasonable to
change the behavior of these constants for BC reasons, and also
since the directory structures are different on Windows and other
systems anyway.  Instead the behavior should be properly
documented.
 [2021-02-12 13:35 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=2b06e6be136cb98831e837b6557d722868bf601c
Log: Fix #61044: invalid PHP_BINDIR
 [2021-02-12 13:35 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2021-02-13 09:34 UTC] mumumu@php.net
Automatic comment on behalf of mumumu@mumumu.org
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=2016f41380b2c7b91b3c2226db761cb9acc54ce4
Log: Fix #61044: invalid PHP_BINDIR
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC