What is PHP ?
PHP is a server-side scripting language designed for Web development, but also used as ageneral-purpose programming language. It was originally created by Rasmus Lerdorf in 1994, the PHP reference implementation is now produced by The PHP Group. PHP originally stood for Personal Home Page, but it now stands for the recursive initialism PHP: Hypertext Preprocessor.How to install PHP in Android ?
Open termux app and type following commands:$ pkg install php
$ pkg install nano
How to install PHP in Ubuntu ?
Open terminal and type following commands:$ sudo apt-get update
$ sudo apt-get install php
To write php script type
$ nano filename.php
Hello world program in php
<?php
echo "hello world!";
?>
To run php script type
$ php filename.php
To run an external (third party, copied) "WORKING" php script :
First save your (executable) script.php in /storage/
example : in /storage/emulated/0/Documents/...FULL...PATH.../
(and other files.txt used by the script, if necessary)
Then in Termux App,
>
cd /storage/emulated/0/Documents/...FULL...PATH.../
>
php script.php
BUT ... before,
"It is necessary to grant storage permission for Termux on [your device with] Android 6 and higher.
Use 'Settings>Apps>Termux>Permissions>Storage' and set to true."
No comments:
Post a Comment