Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.7.5

Bug #1067 backslashes used as path separator on windows break the script index.php
Submitted: 2004-03-24 21:41 UTC
From: pear-dev at mocsnik dot hu Assigned:
Status: Bogus Package: PEAR_Frontend_Web
PHP Version: Irrelevant OS: irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2004-03-24 21:41 UTC] pear-dev at mocsnik dot hu
Description: ------------ Parse error: parse error, unexpected T_STRING in c:\work\htdocs\webdoctor\includes\index.php on line 76 Reproduce code: --------------- simply try to install PEAR using the frontend on windows Expected result: ---------------- install works fine Actual result: -------------- index.php breaks with an error message: Parse error: parse error, unexpected T_STRING in c:\work\htdocs\webdoki\includes\index.php on line 76 This happens because backslash is the path separator on windows and it just happens to be the escape character in strings too... The auto-generated stuff (index.php lines 71-75): if ($env=getenv('PHP_PEAR_PHP_BIN')) { define("PHP_PEAR_PHP_BIN",$env); } else { putenv('PHP_PEAR_PHP_BIN=c:\work\htdocs\webdoctor\includes\'); } should be: putenv('PHP_PEAR_PHP_BIN=c:\work\htdocs\webdoctor\includes\\'); Remember, according to the php manual about single-quoted strings: "If a backslash needs to occur before a single quote or at the end of the string, you need to double it. Note that if you try to escape any other character, the backslash will also be printed! So usually there is no need to escape the backslash itself." This probably appies to the other paths in this file also. I was not the only one meeting with this bug, there was a guy some minutes ago on #PEAR: <Teneberux> I get this :Parse error: parse error in d:\phpdev\www\1index.php on line 76 -- Dunno if the web installer is considered to be stable on windows, it seems there are no other problems using it anyway.. The bug above should be solved asap imho, because people even can't install PEAR with this version. They probably can, if they are lucky: if the paths don't end with a backslash, there's no error report: ('PHP_PEAR_PHP_BIN=c:\work\htdocs\webdoctor\includes');

Comments

 [2004-03-30 00:17 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-03-30 01:10 UTC] pear-dev at mocsnik dot hu
yes, it's v0.3
 [2004-05-31 17:05 UTC] pierre at dotgeek dot org
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Because of this, we hope you add your comments to the existing bug instead. Thank you for your interest in PEAR. See #815