Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #4909 > unrolled thread

PHP Version 5.3.6

Started by"sl@exabyte" <sb5309@hotmail.com>
First post2012-02-20 21:44 +0800
Last post2012-02-23 18:48 +0100
Articles 20 — 12 participants

Back to article view | Back to comp.lang.php


Contents

  PHP Version 5.3.6 "sl@exabyte" <sb5309@hotmail.com> - 2012-02-20 21:44 +0800
    Re: PHP Version 5.3.6 Allodoxaphobia <knock_yourself_out@example.net> - 2012-02-20 16:05 +0000
      Re: PHP Version 5.3.6 "SL" <sb5309@hotmail.com> - 2012-02-21 00:16 +0800
      Re: PHP Version 5.3.6 "SL" <sb5309@hotmail.com> - 2012-02-21 00:19 +0800
        Re: PHP Version 5.3.6 Denis McMahon <denismfmcmahon@gmail.com> - 2012-02-20 16:41 +0000
    Re: PHP Version 5.3.6 Jerry Stuckle <jstucklex@attglobal.net> - 2012-02-20 12:04 -0500
      Re: PHP Version 5.3.6 "sl@exabyte" <sb5309@hotmail.com> - 2012-02-21 10:26 +0800
        Re: PHP Version 5.3.6 Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-02-21 10:02 +0100
        Re: PHP Version 5.3.6 Captain Paralytic <paul_lautman@yahoo.com> - 2012-02-21 02:10 -0800
          Re: PHP Version 5.3.6 The Natural Philosopher <tnp@invalid.invalid> - 2012-02-21 13:00 +0000
            Re: PHP Version 5.3.6 Captain Paralytic <paul_lautman@yahoo.com> - 2012-02-21 05:51 -0800
              Re: PHP Version 5.3.6 The Natural Philosopher <tnp@invalid.invalid> - 2012-02-21 14:20 +0000
      Re: PHP Version 5.3.6: confusing CLI "sl@exabyte" <sb5309@hotmail.com> - 2012-02-22 22:35 +0800
        Re: PHP Version 5.3.6: confusing CLI tony@mountifield.org (Tony Mountifield) - 2012-02-22 15:00 +0000
          Re: PHP Version 5.3.6: confusing CLI Captain Paralytic <paul_lautman@yahoo.com> - 2012-02-22 07:23 -0800
          Re: PHP Version 5.3.6: confusing CLI "SL" <sb5309@hotmail.com> - 2012-02-22 23:49 +0800
        Re: PHP Version 5.3.6: confusing CLI "Peter H. Coffin" <hellsop@ninehells.com> - 2012-02-22 09:13 -0600
        Re: PHP Version 5.3.6: confusing CLI "J.O. Aho" <user@example.net> - 2012-02-22 18:38 +0100
          Re: PHP Version 5.3.6: confusing CLI Jerry Stuckle <jstucklex@attglobal.net> - 2012-02-22 15:03 -0500
        Re: PHP Version 5.3.6: confusing CLI "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-02-23 18:48 +0100

#4909 — PHP Version 5.3.6

From"sl@exabyte" <sb5309@hotmail.com>
Date2012-02-20 21:44 +0800
SubjectPHP Version 5.3.6
Message-ID<jhtiom$pf7$1@news.albasani.net>
My webserver has PHP Version 5.3.6, CGI version I think.

Can I invoke its command line if I have shell access to the server ?

Thanks for info. 

[toc] | [next] | [standalone]


#4910

FromAllodoxaphobia <knock_yourself_out@example.net>
Date2012-02-20 16:05 +0000
Message-ID<slrnjk4rq1.2dcl.knock_yourself_out@shell.config.com>
In reply to#4909
On Mon, 20 Feb 2012 21:44:49 +0800, sl@exabyte wrote:
> My webserver has PHP Version 5.3.6, CGI version I think.
>
> Can I invoke its command line if I have shell access to the server ?

Well, what happened when you tried it?

[toc] | [prev] | [next] | [standalone]


#4911

From"SL" <sb5309@hotmail.com>
Date2012-02-21 00:16 +0800
Message-ID<jhtrl1$c3i$1@news.albasani.net>
In reply to#4910
>> My webserver has PHP Version 5.3.6, CGI version I think.
>>
>> Can I invoke its command line if I have shell access to the server ?
>
> Well, what happened when you tried it?

Never try, I have no shell access now. Thanks. 

[toc] | [prev] | [next] | [standalone]


#4912

From"SL" <sb5309@hotmail.com>
Date2012-02-21 00:19 +0800
Message-ID<jhtrqg$cem$1@news.albasani.net>
In reply to#4910
>> My webserver has PHP Version 5.3.6, CGI version I think.
>>
>> Can I invoke its command line if I have shell access to the server ?
>
> Well, what happened when you tried it?

I faintly remember something like, for version 4 and above (not sure), the 
CLI is included in the package (not sure). 

[toc] | [prev] | [next] | [standalone]


#4913

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2012-02-20 16:41 +0000
Message-ID<4f4277ca$0$21181$a8266bb1@newsreader.readnews.com>
In reply to#4912
On Tue, 21 Feb 2012 00:19:23 +0800, SL wrote:

>>> My webserver has PHP Version 5.3.6, CGI version I think.
>>>
>>> Can I invoke its command line if I have shell access to the server ?
>>
>> Well, what happened when you tried it?
> 
> I faintly remember something like, for version 4 and above (not sure),
> the CLI is included in the package (not sure).

Might be down to the packager for the distro. I think my distro has core, 
cgi and cli packages.

Rgds

Denis McMahon

[toc] | [prev] | [next] | [standalone]


#4914

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-02-20 12:04 -0500
Message-ID<jhtufp$t49$1@dont-email.me>
In reply to#4909
On 2/20/2012 8:44 AM, sl@exabyte wrote:
> My webserver has PHP Version 5.3.6, CGI version I think.
>
> Can I invoke its command line if I have shell access to the server ?
>
> Thanks for info.
>
>

It depends on if you have permission to access the CLI processor.

Did you ask your hosting company?  They should know how they set up 
their servers.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#4915

From"sl@exabyte" <sb5309@hotmail.com>
Date2012-02-21 10:26 +0800
Message-ID<jhuvcn$c61$1@news.albasani.net>
In reply to#4914
> It depends on if you have permission to access the CLI processor.
>
> Did you ask your hosting company?  They should know how they set up
> their servers.

I ask my ISP to installed CLI PHP. It replies saying it is already enabled.

Now I have to find out how to access.

Thanks.


[toc] | [prev] | [next] | [standalone]


#4916

FromErwin Moller <erwinmollerusenet@xs4all.nl>
Date2012-02-21 10:02 +0100
Message-ID<4f435db5$0$6947$e4fe514c@news2.news.xs4all.nl>
In reply to#4915
On 2/21/2012 3:26 AM, sl@exabyte wrote:
>> It depends on if you have permission to access the CLI processor.
>>
>> Did you ask your hosting company?  They should know how they set up
>> their servers.
>
> I ask my ISP to installed CLI PHP. It replies saying it is already enabled.
>
> Now I have to find out how to access.
>
> Thanks.
>
>
>

Did you try ssh to access your (shared) server?
I see in your headers:
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
So my guess is you are on Windows.
The best safe program I know for windows is putty.

Get it here:
http://www.putty.org/

Which will send you to:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

You probably only need putty.exe.

Regards,
Erwin Moller

-- 
"That which can be asserted without evidence, can be dismissed without 
evidence."
-- Christopher Hitchens

[toc] | [prev] | [next] | [standalone]


#4917

FromCaptain Paralytic <paul_lautman@yahoo.com>
Date2012-02-21 02:10 -0800
Message-ID<cdc27ba6-f5f5-43a3-bb37-f7ac4552657e@p12g2000yqe.googlegroups.com>
In reply to#4915
On Feb 21, 2:26 am, "sl@exabyte" <sb5...@hotmail.com> wrote:
> > It depends on if you have permission to access the CLI processor.
>
> > Did you ask your hosting company?  They should know how they set up
> > their servers.
>
> I ask my ISP to installed CLI PHP. It replies saying it is already enabled.
>
> Now I have to find out how to access.
>
> Thanks.

Hmm strange. An ISP supplies an internet connection. Your ISP is
unlikely to have anything to do with your hosting company.

You should follow Jerry's advice and ask your HOSTING COMPANY.
Further, rather than asking them IF they have CLI PHP installed, ask
them HOW to access it!

[toc] | [prev] | [next] | [standalone]


#4918

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-02-21 13:00 +0000
Message-ID<ji04gg$iq5$3@news.albasani.net>
In reply to#4917
Captain Paralytic wrote:
> On Feb 21, 2:26 am, "sl@exabyte" <sb5...@hotmail.com> wrote:
>>> It depends on if you have permission to access the CLI processor.
>>> Did you ask your hosting company?  They should know how they set up
>>> their servers.
>> I ask my ISP to installed CLI PHP. It replies saying it is already enabled.
>>
>> Now I have to find out how to access.
>>
>> Thanks.
> 
> Hmm strange. An ISP supplies an internet connection. Your ISP is
> unlikely to have anything to do with your hosting company.
> 

A hosting company is an internet service provider: its just a different 
service..


> You should follow Jerry's advice and ask your HOSTING COMPANY.
> Further, rather than asking them IF they have CLI PHP installed, ask
> them HOW to access it!

[toc] | [prev] | [next] | [standalone]


#4919

FromCaptain Paralytic <paul_lautman@yahoo.com>
Date2012-02-21 05:51 -0800
Message-ID<291cd0cf-04da-4cc6-8b5b-be4d8bcd8e7d@n12g2000yqb.googlegroups.com>
In reply to#4918
On Feb 21, 1:00 pm, The Natural Philosopher <t...@invalid.invalid>
wrote:
> A hosting company is an internet service provider: its just a different
> service..
http://www.whichisp.com/whatsanisp.html

[toc] | [prev] | [next] | [standalone]


#4920

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-02-21 14:20 +0000
Message-ID<ji0976$tft$1@news.albasani.net>
In reply to#4919
Captain Paralytic wrote:
> On Feb 21, 1:00 pm, The Natural Philosopher <t...@invalid.invalid>
> wrote:
>> A hosting company is an internet service provider: its just a different
>> service..
> http://www.whichisp.com/whatsanisp.html

Which says

"Well, it's a good all round package. remember, as with anything in 
life, you get what you pay (indirectly!!) for. Free UK ISP provide what 
you'd expect with the opportunity for lots of POP3 Email addresses, free 
webspace, webmail client and so on. Most people generally want little 
more than this."

I.e. they themselves clearly place hosted services as an important part 
of 'what an ISP is'

[toc] | [prev] | [next] | [standalone]


#4924 — Re: PHP Version 5.3.6: confusing CLI

From"sl@exabyte" <sb5309@hotmail.com>
Date2012-02-22 22:35 +0800
SubjectRe: PHP Version 5.3.6: confusing CLI
Message-ID<ji2uf9$sca$1@news.albasani.net>
In reply to#4914
> It depends on if you have permission to access the CLI processor.
>
> Did you ask your hosting company?  They should know how they set up
> their servers.

I was given shell access. After fiddling with it, first with:

php -v: out of memory
php aa2.php: : out of memory

Then I tried:

. aa2.php

But strange. In aa2.php, I have:

  echo "123 cli\n";
  echo "Date: " . date("Y.m.d H:i:s");

I get the followings:

==start-log==

[~]# . publci_html/aa2.php public_html/aa2.php
123 cli\n

-jailshell: public_html/aa2.php: line 3: syntax error near unexpected token 
`('

-jailshell: public_html/aa2.php: line 3: `echo "Date: " . date("Y.m.d 
H:i:s"); '

==end-log==

It seems I don't need <?php ..... ?>

But I still have errors.

Gurus please tell me what is this CLI thingie ?

Thanks.







[toc] | [prev] | [next] | [standalone]


#4925 — Re: PHP Version 5.3.6: confusing CLI

Fromtony@mountifield.org (Tony Mountifield)
Date2012-02-22 15:00 +0000
SubjectRe: PHP Version 5.3.6: confusing CLI
Message-ID<ji2vv8$vor$1@softins.clara.co.uk>
In reply to#4924
In article <ji2uf9$sca$1@news.albasani.net>,
sl@exabyte <sb5309@hotmail.com> wrote:
> > It depends on if you have permission to access the CLI processor.
> >
> > Did you ask your hosting company?  They should know how they set up
> > their servers.
> 
> I was given shell access. After fiddling with it, first with:
> 
> php -v: out of memory
> php aa2.php: : out of memory
> 
> Then I tried:
> 
> . aa2.php
> 
> But strange. In aa2.php, I have:
> 
>   echo "123 cli\n";
>   echo "Date: " . date("Y.m.d H:i:s");
> 
> I get the followings:
> 
> ==start-log==
> 
> [~]# . publci_html/aa2.php public_html/aa2.php
> 123 cli\n

That's wrong. The "." command just reads the file for shell commands.
it just so happens that your first echo line is also valid shell syntax.

> -jailshell: public_html/aa2.php: line 3: syntax error near unexpected token 
> `('
> 
> -jailshell: public_html/aa2.php: line 3: `echo "Date: " . date("Y.m.d 
> H:i:s"); '

That's because the second echo line is NOT valid shell syntax.

> ==end-log==
> 
> It seems I don't need <?php ..... ?>

Yes, you do.

> But I still have errors.
> 
> Gurus please tell me what is this CLI thingie ?

You must start your script with <?php and end it with ?>. You can then
invoke it like this:

# php -q myscript.php

You can also put a shebang line before the opening <?php, like this:

#!/usr/bin/php -q
<?php
echo "123 cli\n";
echo "Date: " . date("Y.m.d H:i:s");
?>

Then if you chmod +x the file, you can invoke it directly like this:

# ./myscript.php

Regards
Tony
-- 
Tony Mountifield
Work: tony@softins.co.uk - http://www.softins.co.uk
Play: tony@mountifield.org - http://tony.mountifield.org

[toc] | [prev] | [next] | [standalone]


#4927 — Re: PHP Version 5.3.6: confusing CLI

FromCaptain Paralytic <paul_lautman@yahoo.com>
Date2012-02-22 07:23 -0800
SubjectRe: PHP Version 5.3.6: confusing CLI
Message-ID<99b89ac6-7b7b-44e3-abe0-c6f768d29c15@r1g2000yqk.googlegroups.com>
In reply to#4925
On Feb 22, 3:00 pm, t...@mountifield.org (Tony Mountifield) wrote:
> You must start your script with <?php and end it with ?>.
Well of course, as recently discussed in this group, the ?> is not
actually required.

[toc] | [prev] | [next] | [standalone]


#4928 — Re: PHP Version 5.3.6: confusing CLI

From"SL" <sb5309@hotmail.com>
Date2012-02-22 23:49 +0800
SubjectRe: PHP Version 5.3.6: confusing CLI
Message-ID<ji32r4$55h$1@news.albasani.net>
In reply to#4925
> You must start your script with <?php and end it with ?>. You can then
> invoke it like this:
>
> # php -q myscript.php
>
> You can also put a shebang line before the opening <?php, like this:
>
> #!/usr/bin/php -q
> <?php
> echo "123 cli\n";
> echo "Date: " . date("Y.m.d H:i:s");
>>
>
> Then if you chmod +x the file, you can invoke it directly like this:
>
> # ./myscript.php
>

Hi folks, this 'out of memory' thing, how to deal with it ?

My "aa2.php':

#!/usr/bin/php -q

<?php

echo "123 cli\n";

echo "Date: " . date("Y.m.d H:i:s");

?>

See log:

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2012.02.22 23:39:21 
=~=~=~=~=~=~=~=~=~=~=~=

login as: neighbr or

neighbor@neighborhood-trotter.com's password:

Last login: Wed Feb 22 22:23:31 2012 from 113.210.97.23 -jailshell: 
/etc/init.d/msm_profile: No such file or directory

neighbor@neighborhood-trotter.com [~]# php -q public_html/aa2.php

Out of memory

neighbor@neighborhood-trotter.com [~]# logout

[toc] | [prev] | [next] | [standalone]


#4926 — Re: PHP Version 5.3.6: confusing CLI

From"Peter H. Coffin" <hellsop@ninehells.com>
Date2012-02-22 09:13 -0600
SubjectRe: PHP Version 5.3.6: confusing CLI
Message-ID<slrnjka1gu.rcn.hellsop@nibelheim.ninehells.com>
In reply to#4924
On Wed, 22 Feb 2012 22:35:15 +0800, sl@exabyte wrote:
>> It depends on if you have permission to access the CLI processor.
>>
>> Did you ask your hosting company?  They should know how they set up
>> their servers.
>
> I was given shell access. After fiddling with it, first with:
>
> php -v: out of memory
> php aa2.php: : out of memory
>
> Then I tried:
>
> . aa2.php
>
> But strange. In aa2.php, I have:
>
>   echo "123 cli\n";
>   echo "Date: " . date("Y.m.d H:i:s");
>
> I get the followings:
>
>==start-log==
>
> [~]# . publci_html/aa2.php public_html/aa2.php
> 123 cli\n
>
> -jailshell: public_html/aa2.php: line 3: syntax error near unexpected token 
> `('
>
> -jailshell: public_html/aa2.php: line 3: `echo "Date: " . date("Y.m.d 
> H:i:s"); '
>
>==end-log==
>
> It seems I don't need <?php ..... ?>
>
> But I still have errors.
>
> Gurus please tell me what is this CLI thingie ?

You are not executing those echo commands in PHP. You are executing them
in something called "jailshell". The syntax for the two things is not
the same.

-- 
The plural of datum is not "facts".
A collection of facts is not "knowledge".

[toc] | [prev] | [next] | [standalone]


#4929 — Re: PHP Version 5.3.6: confusing CLI

From"J.O. Aho" <user@example.net>
Date2012-02-22 18:38 +0100
SubjectRe: PHP Version 5.3.6: confusing CLI
Message-ID<9qkngsFuphU1@mid.individual.net>
In reply to#4924
sl@exabyte wrote:
>> It depends on if you have permission to access the CLI processor.
>>
>> Did you ask your hosting company?  They should know how they set up
>> their servers.
>
> I was given shell access. After fiddling with it, first with:
>
> php -v: out of memory
> php aa2.php: : out of memory

https://knowledgebase.servint.net/questions/401/Jailshell

Most likely it's not meant for you to be able to run PHP from CLI but give you 
a way to manipulate your own files.

If you want proper shell access, get your self a VPS (poor mans option) or a 
VM from one of the many providers out there (avoid beyondvps.com).


-- 

   //Aho

[toc] | [prev] | [next] | [standalone]


#4930 — Re: PHP Version 5.3.6: confusing CLI

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-02-22 15:03 -0500
SubjectRe: PHP Version 5.3.6: confusing CLI
Message-ID<ji3hm8$g9p$1@dont-email.me>
In reply to#4929
On 2/22/2012 12:38 PM, J.O. Aho wrote:
> sl@exabyte wrote:
>>> It depends on if you have permission to access the CLI processor.
>>>
>>> Did you ask your hosting company? They should know how they set up
>>> their servers.
>>
>> I was given shell access. After fiddling with it, first with:
>>
>> php -v: out of memory
>> php aa2.php: : out of memory
>
> https://knowledgebase.servint.net/questions/401/Jailshell
>
> Most likely it's not meant for you to be able to run PHP from CLI but
> give you a way to manipulate your own files.
>
> If you want proper shell access, get your self a VPS (poor mans option)
> or a VM from one of the many providers out there (avoid beyondvps.com).
>
>

A VPS is good (I use them), but they also have maintenance 
considerations.  If the op isn't a good Linux admin, I would highly 
recommend a managed VPS.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#4963 — Re: PHP Version 5.3.6: confusing CLI

From"Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid>
Date2012-02-23 18:48 +0100
SubjectRe: PHP Version 5.3.6: confusing CLI
Message-ID<ji5u4n$ue4$1@dont-email.me>
In reply to#4924
El 22/02/2012 15:35, sl@exabyte escribió/wrote:
>> It depends on if you have permission to access the CLI processor.
>>
>> Did you ask your hosting company?  They should know how they set up
>> their servers.
>
> I was given shell access. After fiddling with it, first with:
>
> php -v: out of memory

So PHP is not even functional.


-- 
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web