[TYPO3-core] RFC #16957: Bug: cli_dispatch.phpsh ignores PATH to php and assumes it's in /usr/bin/
Andreas Lappe
nd at off-pist.de
Mon Jan 10 12:32:58 CET 2011
This is an SVN patch request.
Type: Bugfix
Bugtracker references:
http://bugs.typo3.org/view.php?id=16957
Branches:
trunk, and actually all other versions.
Fixing it in trunk for 4.5-LTS would be enough for me though…
Problem:
cli_dispatch.phpsh uses the shebang-line '#! /usr/bin/php -q' which
assumes that your php is installed in /usr/bin/. This is often not the
case on e.g. FreeBSD (because non-system things go into the /usr/local/
tree) and if you have several PHP-installations (e.g. Mac OS X systems
php and one from MacPorts).
Solution:
Using '#! /usr/bin/env php -q' as shebang respects the environment, so
if e.g. /usr/local/bin is in your PATH, this php will be chosen.'
Notes:
Several scripts are using this technique, as does FLOW3. So this should
work on all but the most exotic UNIX-derivates. On windows, as far as I
know, it's invoked differently anyway…
Please review that for 4.5-LTS…
So long
Andy
--
,,Es war nicht glaubwürdig, untunlich und dennoch getan.´´
[Thomas Mann]
-------------- next part --------------
diff --git a/typo3/cli_dispatch.phpsh b/typo3/cli_dispatch.phpsh
index f3d1b00..85097dd 100755
--- a/typo3/cli_dispatch.phpsh
+++ b/typo3/cli_dispatch.phpsh
@@ -1,4 +1,4 @@
-#! /usr/bin/php -q
+#! /usr/bin/env php -q
<?php
/***************************************************************
* Copyright notice
More information about the TYPO3-team-core
mailing list