PHP, MySQL environment configuration

Source: Internet
Author: User

Configuring the PHP Environment under Linux (Ubuntu)

Install MySQL

    • sudo apt-get updateUpdate source

    • apt-get install mysql-server

Installing Nginx

    • apt-get install nginx

Installing php5.6

    • apt-get install software-properties-common python-software-properties

    • add-apt-repository ppa:ondrej/php

    • sudo apt-get update

    • apt-get install php5.6 php5.6-fpm php5.6-gd php5.6-mbstring php5.6-mysql php5.6-zip php5.6-xml php5.6-mcrypt php5.6-redis

Configure Nginx

    • Configuration file in /etc/nginx/site-av .... , you can copy the default configuration modifications directly,

server {Listen 443;    server_name riji.xinbingliang.cn;    SSL on;    root/var/www/riji.xinbingliang.cn;    # ADD index.php to the list if is using PHP index index.php index.html app.php;    # SSL_CERTIFICATE/ETC/NGINX/CERT/RIJI/214437081420556.PEM;    # ssl_certificate_key/etc/nginx/cert/riji/214437081420556.key;    # ssl_session_timeout 5m; # ssl_ciphers ecdhe-rsa-aes128-gcm-sha256:ecdhe:ecdh:aes:high:! null:!anull:! md5:! Adh:!    RC4;    # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;    # ssl_prefer_server_ciphers on;        Location/{index index.php;        Try_files $uri $uri/= 404;        if (!-e $request _filename) {rewrite ^/(. *) $/index.php/$1 last;            }} location ~. php (. *) $ {Fastcgi_pass unix:/run/php/php5.6-fpm.sock;            Fastcgi_index index.php;            Fastcgi_param script_filename $DOCUMENT _root$fastcgi_script_name; Fastcgi_split_path_info ^ (. +\.php) (/?.            +)$;   Fastcgi_param Path_info $;         Include Fastcgi_params; }}
    • Create a soft connection to /etc/nginx/site-en ... on the modified configuration Next

    • Restart Nginx

Related Article

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.