ID: 42103 User updated by: lhanson at clarifysolutions dot co dot uk Reported By: lhanson at clarifysolutions dot co dot uk Status: Bogus Bug Type: CGI related Operating System: windows xp/2000 PHP Version: 5.2.3 New Comment:
I've checked in the my server setup and it is definitely using the ini file that it should be! Got a feeling when running php.exe under CLI it uses another INI file (or something similar) as the script works perfectly when browsed to. I've tried the same script across two different instances of apache php. It works fine in 5.2.0 from a browser and from CLI but with 5.2.3 it works in the browser but not from the CLI. It is the CLI I wanted to get working.. as it is a backup script. I managed to solve the problem by making the script start with <?php rather than <?.... any other ideas... or knowledge of why a script would run in the browser yet not under the CLI?! Thank you for your time Lee Previous Comments: ------------------------------------------------------------------------ [2007-07-25 14:24:33] [EMAIL PROTECTED] They work just fine here. Check your php.ini settings and that it's actually been read by PHP. You can check it in phpinfo() section where it says what, if any, php.ini was actually loaded. ------------------------------------------------------------------------ [2007-07-25 13:34:37] lhanson at clarifysolutions dot co dot uk Description: ------------ It appears that there is a problem when attempting execute a script from the command line. If the script has Short open tags "<?" instead of "<?php" php.exe does not seem to recognise that we are starting php code. I tried to tell php.exe to use a specific ini file (with the -c switch) that had open short tags enabled. However no avail. It also took me quite a long time to realise that it was the tags that was causing me the issue. I am wondering what the reasons would be for removing the acceptance of short tags from the command line interface... If you have any answers on this please do get in contact Reproduce code: --------------- <? $i = 10 echo 'im being displayed in the cli. i = '.$i ?> Expected result: ---------------- im being displayed in the cli. i = 10 Actual result: -------------- <? $i = 10 echo 'im being displayed in the cli. i = '.$i ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42103&edit=1