Debian7.7 quickly build lamp and lnmp environments

Source: Internet
Author: User
Tags config php pear

Debian quickly build lamp and lnmp environments

Operating system environment: debian7.7


Install the lamp environment


Apt-get install apache2 mysql-server php5 php-pear php5-mysql php5-gd php5-curl php5-common php5-dev php5-xcache-y


Echo "<? Php phpinfo ();?> ">/Var/www/index. php


[Email protected]: ~ # Curl-I http: // 192.168.5.44/index. php

HTTP/1.1 200 OK

Date: Thu, 06 Nov 2014 08:57:05 GMT

Server: Apache/2.2.22 (Debian)

X-Powered-By: PHP/5.4.34-0 + deb7u1

Vary: Accept-Encoding

Content-Type: text/html



Install the lnmp environment


Apt-get install nginx mysql-server php5 php5-fpm php-pear php5-mysql php5-gd php5-curl php5-common php5-dev php5-xcache-y



Echo "<? Php phpinfo ();?> ">/Usr/share/nginx/www/index. php


# Config nginx


Vim/etc/nginx/sites-available/default


Location ~ \. Php $ {

Fastcgi_split_path_info ^ (. + \. php) (/. +) $;

# NOTE: You shoshould have "cgi. fix_pathinfo = 0;" in php. ini

#

# With php5-cgi alone:

Fastcgi_pass 127.0.0.1: 9000;

# With php5-fpm:

# Fastcgi_pass unix:/var/run/php5-fpm.sock;

Fastcgi_index index. php;

Include fastcgi_params;

}



# Config php-fpm

Vim/etc/php5/fpm/pool. d/www. conf


# Listen =/var/run/php5-fpm.sock

Listen = 127.0.0.1: 9000



# Restart nginx php-fpm


/Etc/init. d/nginx restart

/Etc/init. d/php5-fpm restart



[Email protected]: ~ # Curl-I http: // 192.168.5.44/index. php

HTTP/1.1 200 OK

Server: nginx/1.2.1

Date: Thu, 06 Nov 2014 12:11:44 GMT

Content-Type: text/html

Connection: keep-alive

X-Powered-By: PHP/5.4.34-0 + deb7u1







This article is from the "linux learning history" blog, please be sure to keep this source http://micheng.blog.51cto.com/1463868/1573834

Debian7.7 quickly build lamp and lnmp environments

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.