FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP Version 5.3.6
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
PHP Version 5.3.6 [message #177092] Mon, 20 February 2012 13:44 Go to next message
sl@exabyte is currently offline  sl@exabyte
Messages: 16
Registered: March 2011
Karma: 0
Junior Member
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.
Re: PHP Version 5.3.6 [message #177093 is a reply to message #177092] Mon, 20 February 2012 16:05 Go to previous messageGo to next message
Allodoxaphobia is currently offline  Allodoxaphobia
Messages: 21
Registered: September 2010
Karma: 0
Junior Member
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?
Re: PHP Version 5.3.6 [message #177094 is a reply to message #177093] Mon, 20 February 2012 16:16 Go to previous messageGo to next message
SL is currently offline  SL
Messages: 20
Registered: February 2012
Karma: 0
Junior Member
>> 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.
Re: PHP Version 5.3.6 [message #177095 is a reply to message #177093] Mon, 20 February 2012 16:19 Go to previous messageGo to next message
SL is currently offline  SL
Messages: 20
Registered: February 2012
Karma: 0
Junior Member
>> 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).
Re: PHP Version 5.3.6 [message #177096 is a reply to message #177095] Mon, 20 February 2012 16:41 Go to previous messageGo to next message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
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
Re: PHP Version 5.3.6 [message #177097 is a reply to message #177092] Mon, 20 February 2012 17:04 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: PHP Version 5.3.6 [message #177098 is a reply to message #177097] Tue, 21 February 2012 02:26 Go to previous messageGo to next message
SL is currently offline  SL
Messages: 20
Registered: February 2012
Karma: 0
Junior Member
> 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.
Re: PHP Version 5.3.6 [message #177099 is a reply to message #177098] Tue, 21 February 2012 09:02 Go to previous messageGo to next message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma: 0
Senior Member
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
Re: PHP Version 5.3.6 [message #177100 is a reply to message #177098] Tue, 21 February 2012 10:10 Go to previous messageGo to next message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
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!
Re: PHP Version 5.3.6 [message #177101 is a reply to message #177100] Tue, 21 February 2012 13:00 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
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!
Re: PHP Version 5.3.6 [message #177102 is a reply to message #177101] Tue, 21 February 2012 13:51 Go to previous messageGo to next message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
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
Re: PHP Version 5.3.6 [message #177103 is a reply to message #177102] Tue, 21 February 2012 14:20 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
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'
Re: PHP Version 5.3.6: confusing CLI [message #177107 is a reply to message #177097] Wed, 22 February 2012 14:35 Go to previous messageGo to next message
SL is currently offline  SL
Messages: 20
Registered: February 2012
Karma: 0
Junior Member
> 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.
Re: PHP Version 5.3.6: confusing CLI [message #177108 is a reply to message #177107] Wed, 22 February 2012 15:00 Go to previous messageGo to next message
tony is currently offline  tony
Messages: 19
Registered: December 2010
Karma: 0
Junior Member
In article <ji2uf9$sca$1(at)news(dot)albasani(dot)net>,
sl@exabyte <sb5309(at)hotmail(dot)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(at)softins(dot)co(dot)uk - http://www.softins.co.uk
Play: tony(at)mountifield(dot)org - http://tony.mountifield.org
Re: PHP Version 5.3.6: confusing CLI [message #177109 is a reply to message #177107] Wed, 22 February 2012 15:13 Go to previous messageGo to next message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma: 0
Senior Member
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".
Re: PHP Version 5.3.6: confusing CLI [message #177110 is a reply to message #177108] Wed, 22 February 2012 15:23 Go to previous messageGo to next message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
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.
Re: PHP Version 5.3.6: confusing CLI [message #177111 is a reply to message #177108] Wed, 22 February 2012 15:49 Go to previous messageGo to next message
SL is currently offline  SL
Messages: 20
Registered: February 2012
Karma: 0
Junior Member
> 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(at)neighborhood-trotter(dot)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(at)neighborhood-trotter(dot)com [~]# php -q public_html/aa2.php

Out of memory

neighbor(at)neighborhood-trotter(dot)com [~]# logout
Re: PHP Version 5.3.6: confusing CLI [message #177112 is a reply to message #177107] Wed, 22 February 2012 17:38 Go to previous messageGo to next message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma: 0
Senior Member
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
Re: PHP Version 5.3.6: confusing CLI [message #177113 is a reply to message #177112] Wed, 22 February 2012 20:03 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: PHP Version 5.3.6: confusing CLI [message #177145 is a reply to message #177107] Thu, 23 February 2012 17:48 Go to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
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
--
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: jailshell and PHP daemon
Next Topic: way to turn off strict option? Use of undefined constant
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 23:18:56 GMT 2024

Total time taken to generate the page: 0.02459 seconds