TIME NOW
World current time now,
CALENDAR
Calendar monthly, yearly
login GOLD PRICE, RATE
login HOROSCOPE
login DICTIONARIES, LISTS
login SCIENCE EDUCATION RELIGION
login FINANCE, BUSINESS
login WORLD COUNTRIES, WIKI

PHP scripts, code, examples, tutorial

Previous articlePage bottom  ALL TOPICS

PHP. Run PHP via Linux

 1. File php.scr, permissions rwxr-x---, user root     
#!/usr/local/bin/php
<?php

$a = 1;
$b = 2;

echo "vars \t$a \t$b\n";

?>

2. :

#!/usr/bin/php
<?php

//########################### 1 ##################################

print "uname - ".exec("uname")."\n\n";

//########################### 2 ##################################

print "hostname - ".shell_exec("hostname")."\n";

//########################### 3 ###################################

system("uptime");

?>

3.:
#!/bin/bash

date

##################### 1 #############################

pv='External BASH variable print test.'

php_cmds=`
/usr/bin/php << EOF
<?php
print("\n"."PHP version is: ".phpversion()."\n\n");
print("$pv");
?>
EOF`

echo "$php_cmds"

######################## 2 #######################

php -r '
print("\n");
print("Zend version is: ".zend_version()."\n\n");
'

######################## 3 #######################

php -r 'echo phpinfo();' | grep -e "=>" | more
 
Previous articlePage top  ALL TOPICS



 Use username: Guest, Anonymous, Programmer






QUOTES:
It is a true saying that a man must eat a peck of salt with his friend before he knows him.
Miguel de Cervantes
Where love rules, there is no will to power, and where power predominates, love is lacking. The one is the shadow of the other.
Carl Jung, 'On the Psychology of the Unconciousness', 1917
I am the way and the truth and the life. No one comes to the Father except through me.
Bible