Re: PHP Version 5.3.6: confusing CLI [message #177111 is a reply to message #177108] |
Wed, 22 February 2012 15:49 |
SL
Messages: 20 Registered: February 2012
Karma:
|
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
|
|
|