openSUSE Installation LEMP/LNMP Kit in CentOS

Source: Internet
Author: User
Tags file info fpm memcached php file centos nginx server

openSUSE Installation LEMP/LNMP Kit

1. Install Nginx, PHP5 and MARIADB

Zypper install nginx php5 php5-fpm php5-mysql mariadb-tool mariadb mariadb-client
2. Adjust the Nginx configuration file

Add the following in the server block in/etc/nginx/nginx.conf

Note: The default installation Nginx has a similar content that is commented out, but unlike the following configuration $document_root, the default configuration will result in a failure to locate the file.

Location ~\.php$
{
root/usr/share/nginx/html;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root/$fastcgi _script_name;
Include Fastcgi_params;
}
3. Start Nginx

Systemctl start Nginx
4. Copy PHP-FPM configuration file

Cp/etc/php5/fpm/php-fpm.conf.default/etc/php5/fpm/php-fpm.conf
5. Start PHP-FPM

Systemctl Start PHP-FPM
6. Create a test file info.php file under the default directory (/srv/www/htdocs), as follows

<?php phpinfo ();?>
If you visit the http://public network ip/info.php, you can see the PHP information page, that is, success.

7. Start MARIADB

Systemctl start MySQL
8. Set self-starter

Systemctl enable MySQL Nginx php-fpm
Default configuration file Location

Nginx configuration file:
Master configuration file:/etc/nginx/nginx.conf
Nginx Server configuration file:/etc/nginx/conf.d/default.conf

PHP configuration file:
/etc/php5/cli/php.ini

PHP-FPM configuration file:
/etc/php5/fpm/php-fpm.conf
9. Expansion: for PHP installation memcached expansion

There are many ways to install memcached expansion, you can use Pcel for installation (transfer), this article will use the traditional compiler installation mode

A. Installing the necessary libraries and compiling the software

Zypper in libmemcached libmemcached-devel php5-devel gcc
B. Download and extract php-memcached (recommended download address: http://pecl.php.net/package/memcached)

wget http://pecl.php.net/get/memcached-2.2.0.tgz
Tar zxvf memcached-2.2.0.tgz
CD memcached-2.2.0
C.phpize Command Generation Configure

Phpize
D. Compiling and installing the Memcached Development Library

./configure--enable-memcached
Make && make install
When successful, the file is generated under/usr/lib64/php5/extensions memcached.so

E. Add the Memcached.ini under this catalogue to the following contents

Extension=memcached.so
Copy memcached to PHP configuration folder

CP MEMCACHED.INI/ETC/PHP5/CONF.D
F. Verify the success of the memcached installation

Php-m
If successful, you will see memcached in the return content

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.