Environment Installation Script

LNP environment

Nginx + PHP + Composer + Supervisor

Applicable to Laravel environment

  • Contains: Nginx, PHP 7.2, Composer, Supervisor
  • PHP module: fileinfo, imap, ldap, redis, memcached, swoole


# Install Nginx + PHP and copy all four lines together
wget -c http://mirrors.linuxeye.com/oneinstack-full.tar.gz \
&& tar xzf oneinstack-full.tar.gz && ./oneinstack/install.sh \
--nginx_option 1 --php_option 7 --phpcache_option 1 \
--php_extensions fileinfo,imap,ldap,redis,memcached,swoole

# Install Composer
yum install composer

# Install Supervisor
yum install supervisor

Service management

# Registration service
systemctl enable nginx
systemctl enable php-fpm
systemctl enable supervisor

# Startup service
systemctl start nginx
systemctl start php-fpm
systemctl start supervisor

# Restart service
systemctl restart nginx
systemctl restart php-fpm
systemctl restart supervisor

# View service status
systemctl status nginx
systemctl status php-fpm
systemctl status supervisor

PHP Module and Configuration

Add modules on demand

# First enter the oneinstack directory, and then execute

## Add redis
./install.sh --php_extensions redis

## Add swoole
./install.sh --php_extensions swoole

## Add fileinfo
./install.sh --php_extensions fileinfo

Enable proc_open

;; Laravel schedule Require system process permissions proc_open, proc_get_status

;; find

disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen

;; Change to

disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen

Reference resources

Install Nginx; PHP version 7.3; PHP extension selection imagick,fileinfo,imap,ldap,redis,swoole; no database; other functions are not installed.

If there is no installation of components, subsequent installation, unified entry is./install.sh, addons.sh script is no longer provided.

If the php redis extension has not been installed before, add the installation command:. / install.sh --php_extensions redis

If the php fileinfo extension has not been installed before, add the installation command:. / install.sh --php_extensions fileinfo

Tags: Web Server PHP Nginx supervisor Redis

Posted on Mon, 07 Oct 2019 03:14:36 -0700 by Phoenixheart