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 have now found why php.exe was NOT working the same as the browser.
This is because php.exe although I had attempted to use -c and -n
switches to specify the INI location was using a different INI to the
apache server.

I found that php.exe was just using the INI within my PHP directory
where as apache was using the one I had configured. 

Running phpinfo() gives no hints to this through the browser as it
picks up the INI file used by apache. As i had already discerned the
issue was with 'short_open_tag', i used ini_get() from the CLI to
discern that this was not switched on... I then located the most obvoius
INI (in the php directory) and altered the open_short_tag.... hence
problem solved... 

why php.exe from the CLI would not use the INI told to by using -c and
why php.exe does not pick up and use the same INI as apache is a mystery
I have'nt yet unravelled

Thanks
Lee


Previous Comments:
------------------------------------------------------------------------

[2007-07-25 14:34:47] lhanson at clarifysolutions dot co dot uk

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

------------------------------------------------------------------------

[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

Reply via email to