Re: php-cli
am 14.03.2010 19:13:24 von Ashley Sheridan
--=-ijKj0nLlcn18MKtBclZn
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
On Sun, 2010-03-14 at 14:15 -0400, Rick Pasotto wrote:
> Has cli php changed recently?
>
> I've got a php script (script1) that creates a php script (script2) by
> opening a file and then writing to it. When I try to run it from the
> command line script1 is simply copied to stdout. When I run it from the
> browser it works as expected. The directory has 777 permissions so that
> should not be the problem.
>
> Any ideas?
>
> --
> "Whatever the immediate gains and losses, the dangers to our safety
> arising from political suppression are always greater than the dangers
> to that safety resulting from political freedom. Suppression is always
> foolish. Freedom is always wise." -- Alexander Meiklejohn, 1955
> Rick Pasotto rick@niof.net http://www.niof.net
>
How are you running it from the command line?
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-ijKj0nLlcn18MKtBclZn--
php-cli
am 14.03.2010 19:15:12 von Rick Pasotto
Has cli php changed recently?
I've got a php script (script1) that creates a php script (script2) by
opening a file and then writing to it. When I try to run it from the
command line script1 is simply copied to stdout. When I run it from the
browser it works as expected. The directory has 777 permissions so that
should not be the problem.
Any ideas?
--
"Whatever the immediate gains and losses, the dangers to our safety
arising from political suppression are always greater than the dangers
to that safety resulting from political freedom. Suppression is always
foolish. Freedom is always wise." -- Alexander Meiklejohn, 1955
Rick Pasotto rick@niof.net http://www.niof.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: php-cli
am 14.03.2010 21:40:51 von Ashley Sheridan
--=-SJH6BS37kHbfad/h8cIY
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
On Sun, 2010-03-14 at 16:41 -0400, Rick Pasotto wrote:
> On Sun, Mar 14, 2010 at 06:13:24PM +0000, Ashley Sheridan wrote:
> > On Sun, 2010-03-14 at 14:15 -0400, Rick Pasotto wrote:
> >
> > > Has cli php changed recently?
> > >
> > > I've got a php script (script1) that creates a php script (script2) by
> > > opening a file and then writing to it. When I try to run it from the
> > > command line script1 is simply copied to stdout. When I run it from the
> > > browser it works as expected. The directory has 777 permissions so that
> > > should not be the problem.
> > >
> > > Any ideas?
> >
> > How are you running it from the command line?
>
> Is there more than one way? I suppose with and without the -f could
> count as two ways, but the man page says without defaults to with so
> they're really the same.
>
> --
> "Remember, today is the tomorrow you worried about yesterday."
> -- Dale Carnegie
> Rick Pasotto rick@niof.net http://www.niof.net
>
Well you havn't given an example, and just say you're calling the script
from command line and it's outputting the script there. Are you maybe
just calling the php file without calling php first?
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-SJH6BS37kHbfad/h8cIY--
Re: php-cli
am 14.03.2010 21:41:15 von Rick Pasotto
On Sun, Mar 14, 2010 at 06:13:24PM +0000, Ashley Sheridan wrote:
> On Sun, 2010-03-14 at 14:15 -0400, Rick Pasotto wrote:
>
> > Has cli php changed recently?
> >
> > I've got a php script (script1) that creates a php script (script2) by
> > opening a file and then writing to it. When I try to run it from the
> > command line script1 is simply copied to stdout. When I run it from the
> > browser it works as expected. The directory has 777 permissions so that
> > should not be the problem.
> >
> > Any ideas?
>
> How are you running it from the command line?
Is there more than one way? I suppose with and without the -f could
count as two ways, but the man page says without defaults to with so
they're really the same.
--
"Remember, today is the tomorrow you worried about yesterday."
-- Dale Carnegie
Rick Pasotto rick@niof.net http://www.niof.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: php-cli
am 15.03.2010 01:27:17 von Rick Pasotto
On Sun, Mar 14, 2010 at 08:40:51PM +0000, Ashley Sheridan wrote:
> On Sun, 2010-03-14 at 16:41 -0400, Rick Pasotto wrote:
>
> > On Sun, Mar 14, 2010 at 06:13:24PM +0000, Ashley Sheridan wrote:
> > > On Sun, 2010-03-14 at 14:15 -0400, Rick Pasotto wrote:
> > >
> > > > Has cli php changed recently?
> > > >
> > > > I've got a php script (script1) that creates a php script (script2) by
> > > > opening a file and then writing to it. When I try to run it from the
> > > > command line script1 is simply copied to stdout. When I run it from the
> > > > browser it works as expected. The directory has 777 permissions so that
> > > > should not be the problem.
> > > >
> > > > Any ideas?
> > >
> > > How are you running it from the command line?
> >
> > Is there more than one way? I suppose with and without the -f could
> > count as two ways, but the man page says without defaults to with so
> > they're really the same.
>
> Well you havn't given an example, and just say you're calling the script
> from command line and it's outputting the script there. Are you maybe
> just calling the php file without calling php first?
Of course not. php scripts are not executable. If I had tried to execute
it directly the shell would have told me that. If I had then set the
executable bit the shell would have tried to execute the contents of the
file and the shell would have given several error messages.
I repeat: is there more than one way to run a php script from the cli?
--
"Feeling sorry for yourself, and you present condition, is not only a
waste of energy but the worst habit you could possibly have."
-- Dale Carnegie
Rick Pasotto rick@niof.net http://www.niof.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: php-cli
am 15.03.2010 01:32:24 von Dmitry Ruban
Rick Pasotto wrote:
> On Sun, Mar 14, 2010 at 08:40:51PM +0000, Ashley Sheridan wrote:
>> On Sun, 2010-03-14 at 16:41 -0400, Rick Pasotto wrote:
>>
>>> On Sun, Mar 14, 2010 at 06:13:24PM +0000, Ashley Sheridan wrote:
>>>> On Sun, 2010-03-14 at 14:15 -0400, Rick Pasotto wrote:
>>>>
>>>>> Has cli php changed recently?
>>>>>
>>>>> I've got a php script (script1) that creates a php script (script2) by
>>>>> opening a file and then writing to it. When I try to run it from the
>>>>> command line script1 is simply copied to stdout. When I run it from the
>>>>> browser it works as expected. The directory has 777 permissions so that
>>>>> should not be the problem.
>>>>>
>>>>> Any ideas?
>>>> How are you running it from the command line?
>>> Is there more than one way? I suppose with and without the -f could
>>> count as two ways, but the man page says without defaults to with so
>>> they're really the same.
>> Well you havn't given an example, and just say you're calling the script
>> from command line and it's outputting the script there. Are you maybe
>> just calling the php file without calling php first?
>
> Of course not. php scripts are not executable. If I had tried to execute
> it directly the shell would have told me that. If I had then set the
> executable bit the shell would have tried to execute the contents of the
> file and the shell would have given several error messages.
>
> I repeat: is there more than one way to run a php script from the cli?
>
On *nix, you can add "#!/usr/bin/php" as first line and make file
executable (chmod +x).
--
Dmitry
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: php-cli
am 15.03.2010 01:53:42 von Ashley Sheridan
--=-wOE5elOJcTGLx7Ypq51s
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
On Sun, 2010-03-14 at 20:27 -0400, Rick Pasotto wrote:
> On Sun, Mar 14, 2010 at 08:40:51PM +0000, Ashley Sheridan wrote:
> > On Sun, 2010-03-14 at 16:41 -0400, Rick Pasotto wrote:
> >
> > > On Sun, Mar 14, 2010 at 06:13:24PM +0000, Ashley Sheridan wrote:
> > > > On Sun, 2010-03-14 at 14:15 -0400, Rick Pasotto wrote:
> > > >
> > > > > Has cli php changed recently?
> > > > >
> > > > > I've got a php script (script1) that creates a php script (script2) by
> > > > > opening a file and then writing to it. When I try to run it from the
> > > > > command line script1 is simply copied to stdout. When I run it from the
> > > > > browser it works as expected. The directory has 777 permissions so that
> > > > > should not be the problem.
> > > > >
> > > > > Any ideas?
> > > >
> > > > How are you running it from the command line?
> > >
> > > Is there more than one way? I suppose with and without the -f could
> > > count as two ways, but the man page says without defaults to with so
> > > they're really the same.
> >
> > Well you havn't given an example, and just say you're calling the script
> > from command line and it's outputting the script there. Are you maybe
> > just calling the php file without calling php first?
>
> Of course not. php scripts are not executable. If I had tried to execute
> it directly the shell would have told me that. If I had then set the
> executable bit the shell would have tried to execute the contents of the
> file and the shell would have given several error messages.
>
> I repeat: is there more than one way to run a php script from the cli?
>
> --
> "Feeling sorry for yourself, and you present condition, is not only a
> waste of energy but the worst habit you could possibly have."
> -- Dale Carnegie
> Rick Pasotto rick@niof.net http://www.niof.net
>
I was just asking how you were running it, and havn't been given a
straight answer yet, so I'll assume you're doing something like this:
php /var/www/html/script.php
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-wOE5elOJcTGLx7Ypq51s--
Re: php-cli
am 15.03.2010 02:24:40 von Rick Pasotto
On Mon, Mar 15, 2010 at 01:32:24PM +1300, Dmitry Ruban wrote:
> Rick Pasotto wrote:
> >
> >I repeat: is there more than one way to run a php script from the cli?
> >
>
> On *nix, you can add "#!/usr/bin/php" as first line and make file
> executable (chmod +x).
Functionally the same. php is still interpreting the script. The script
is still not an executable.
And, of course, the results are the same.
The problem is that php is *not* interpreting the script. It's acting
like 'cat'.
--
"There are two tragedies in life. One is to lose your heart's desire.
The other is to gain it." -- George Bernard Shaw
Rick Pasotto rick@niof.net http://www.niof.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: php-cli
am 15.03.2010 02:28:31 von Ashley Sheridan
--=-YL0zXK+R85UWlRIWXcQB
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
On Sun, 2010-03-14 at 21:24 -0400, Rick Pasotto wrote:
> On Mon, Mar 15, 2010 at 01:32:24PM +1300, Dmitry Ruban wrote:
> > Rick Pasotto wrote:
> > >
> > >I repeat: is there more than one way to run a php script from the cli?
> > >
> >
> > On *nix, you can add "#!/usr/bin/php" as first line and make file
> > executable (chmod +x).
>
> Functionally the same. php is still interpreting the script. The script
> is still not an executable.
>
> And, of course, the results are the same.
>
> The problem is that php is *not* interpreting the script. It's acting
> like 'cat'.
>
> --
> "There are two tragedies in life. One is to lose your heart's desire.
> The other is to gain it." -- George Bernard Shaw
> Rick Pasotto rick@niof.net http://www.niof.net
>
Have you looked at the error log? Is the php-cli package installed
correctly?
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-YL0zXK+R85UWlRIWXcQB--
Re: php-cli
am 15.03.2010 02:35:54 von Dmitry Ruban
Rick Pasotto wrote:
> On Mon, Mar 15, 2010 at 01:32:24PM +1300, Dmitry Ruban wrote:
>> Rick Pasotto wrote:
>>> I repeat: is there more than one way to run a php script from the cli?
>>>
>> On *nix, you can add "#!/usr/bin/php" as first line and make file
>> executable (chmod +x).
>
> Functionally the same. php is still interpreting the script. The script
> is still not an executable.
>
> And, of course, the results are the same.
>
> The problem is that php is *not* interpreting the script. It's acting
> like 'cat'.
>
It sounds like you may use short tags "" and short_open_tag is off in
your cli php.ini
What does it show:
php -r 'phpinfo();' | grep short
--
Dmitry
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: php-cli
am 15.03.2010 04:14:50 von Rick Pasotto
On Mon, Mar 15, 2010 at 02:35:54PM +1300, Dmitry Ruban wrote:
> Rick Pasotto wrote:
> >On Mon, Mar 15, 2010 at 01:32:24PM +1300, Dmitry Ruban wrote:
> >>Rick Pasotto wrote:
> >>>I repeat: is there more than one way to run a php script from the cli?
> >>>
> >>On *nix, you can add "#!/usr/bin/php" as first line and make file
> >>executable (chmod +x).
> >
> >Functionally the same. php is still interpreting the script. The script
> >is still not an executable.
> >
> >And, of course, the results are the same.
> >
> >The problem is that php is *not* interpreting the script. It's acting
> >like 'cat'.
> >
>
> It sounds like you may use short tags "" and short_open_tag is off
> in your cli php.ini
Thank you. That was the problem.
Looks like I've got a habit to change and a lot of file maintenance to do.
--
"There are two tragedies in life. One is to lose your heart's desire.
The other is to gain it." -- George Bernard Shaw
Rick Pasotto rick@niof.net http://www.niof.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: php-cli
am 16.03.2010 13:17:52 von Richard Quadling
On 15 March 2010 00:27, Rick Pasotto wrote:
> On Sun, Mar 14, 2010 at 08:40:51PM +0000, Ashley Sheridan wrote:
>> On Sun, 2010-03-14 at 16:41 -0400, Rick Pasotto wrote:
>>
>> > On Sun, Mar 14, 2010 at 06:13:24PM +0000, Ashley Sheridan wrote:
>> > > On Sun, 2010-03-14 at 14:15 -0400, Rick Pasotto wrote:
>> > >
>> > > > Has cli php changed recently?
>> > > >
>> > > > I've got a php script (script1) that creates a php script (script2=
) by
>> > > > opening a file and then writing to it. When I try to run it from t=
he
>> > > > command line script1 is simply copied to stdout. When I run it fro=
m the
>> > > > browser it works as expected. The directory has 777 permissions so=
that
>> > > > should not be the problem.
>> > > >
>> > > > Any ideas?
>> > >
>> > > How are you running it from the command line?
>> >
>> > Is there more than one way? I suppose with and without the -f could
>> > count as two ways, but the man page says without defaults to with so
>> > they're really the same.
>>
>> Well you havn't given an example, and just say you're calling the script
>> from command line and it's outputting the script there. Are you maybe
>> just calling the php file without calling php first?
>
> Of course not. php scripts are not executable. If I had tried to execute
> it directly the shell would have told me that. If I had then set the
> executable bit the shell would have tried to execute the contents of the
> file and the shell would have given several error messages.
>
> I repeat: is there more than one way to run a php script from the cli?
>
> --
> "Feeling sorry for yourself, and you present condition, is not only a
> Â waste of energy but the worst habit you could possibly have."
> Â Â Â Â -- Dale Carnegie
>   Rick Pasotto   rick@niof.net   http://=
www.niof.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Be careful. .BAT files are not executable, but you don't need to put
the command line processor in front do you?
You can quite easily turn ...
C:\PHP5\PHP.exe -f C:\Pathed\Directory\Script.php -- -script_arg1 -script_a=
rg2
into
Script -script_arg1 -script_arg2
No php.exe, no .php, no -f
See http://docs.php.net/manual/en/install.windows.commandline.ph p
You can even turn php scripts into filters ...
Script -script_arg1 -script_arg2 | Script2 -script_arg1 -script_arg2
sort of thing.
--=20
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474=
731
ZOPA : http://uk.zopa.com/member/RQuadling
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php