1. PHP (full name: Php:hypertext preprocessor, or "PHP: Hypertext Preprocessor") is a common open source scripting language.
2. PHP files can contain text, HTML, JavaScript code and PHP code, PHP code executed on the server, the results are returned in plain HTML to the browser, PHP file is the default file name extension ". php".
3. PHP can generate dynamic page content, create, open, read, write, close files on the server, collect form data, send and receive cookies, add, delete, modify data in your database, restrict access to some pages on your website, encrypt data. With PHP, you are no longer limited to outputting HTML. You can export images, PDF files, or even Flash movies. You can also export arbitrary text, such as XHTML and XML.
4, PHP can be run in Windows, Linux, Unix, Mac OS X, and almost all of the server compatibility, database support a wide range. PHP is free, easy to learn, runs efficiently and can be downloaded from www.php.net for free.
Simple code.
PHP environment Setup, enter the following code in the terminal, install the software installed behind:
sudo apt-get install apache2
sudo add-apt-repository-y ppa:ondrej/php
sudo apt update
sudo apt install php7.0
sudo apt install-y mysql-server mysql-client
sudo apt-get install libapache2-mod-php7.0
sudo apt-get install Php7.0-mysql
sudo apt-get install PHP7.0-GDsudo apt-get install phpMyAdmin
During installation, you will be asked to select the Web server:apache2 or LIGHTTPD, use the SPACEBAR to choose Apache2, and then confirm that the following interface enters the password that you set when you just installed MySQL, OK. Confirm the MySQL password once again, OK. The phpMyAdmin is then connected to the Apache2,
sudo ln-s/usr/share/phpmyadmin/var/www/html
To a simple test,
Start Apache2
Sudo/etc/init.d/apache2 restart
Create a new PHP file under the Phptest directory: test.php
sudo gedit/var/www/html/test.php
Enter the contents of the Gedit:
<! DOCTYPE html>
Save exit
Open the browser input in the URL field
http://localhost/test.php
Enter to view running results
In addition the terminal input
Php-v to view PHP versions
Enter 127.0.0.1 or localhost in the browser, as seen in the Apache2
steps to read