PHP Introduction ubuntu16.04 PHP Environment configuration and a Web page

Source: Internet
Author: User
Tags php introduction

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

  2. 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-GD

    sudo 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

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

  4. Enter the contents of the Gedit:

    <! DOCTYPE html>

    Save exit

  5. Open the browser input in the URL field

    http://localhost/test.php

    Enter to view running results

  6. In addition the terminal input

    Php-v to view PHP versions

  7. Enter 127.0.0.1 or localhost in the browser, as seen in the Apache2

    steps to read

PHP Introduction ubuntu16.04 PHP Environment configuration and a Web page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.