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