How to install PHP in Android using Termux




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."

NOTE: This article is only for an Educational purpose. Any actions or activities related to the material contained on this Website is solely your responsibility.  Misuse of the information in this website can result in criminal charges brought against the persons in question. The Authors and Hackers Dormitory.will not be held responsible in the event any criminal charges be brought against any individuals misusing the information in this website to break the law.


No comments:

Thanks for coming on my blog hackersdormitory hope you like it

INSTAGRAM FEED

@_mr_rudr_