Using the Websoft9 LNMP, you should have some skills for configure PHP like below:



For the above content, we have prepared the PHP Quik Start for users.


------


Top3 PHP configuration you must use when using this Image


#1 Modify the php.ini


When you want to modify The PHP File Upload LimitMax Execution TimeMemory Limit..., please use SFTP to modify the /etc/php.ini, for example:


# File upload limit
post_max_size = 16M
upload_max_filesize = 16M

# Max Execution Time
max_execution_time = 90

# Memory Limit
memory_limit – Minimum: 256M


#2 Install php module


LNMP Image have installed the most useful modules, but some times you may want to intall more module according to your application. E.g Install the swoole, below are the steps:


# Search "php70 swoole" mean swoole for php70
yum search php70 swoole

# Search result
php70-php-pecl-swoole-devel.x86_64 : php70-php-pecl-swoole developer files
                                   : (header)
php70-php-pecl-swoole2-devel.x86_64 : php70-php-pecl-swoole2 developer files
                                    : (header)
php70-php-pecl-swoole4-devel.x86_64 : php70-php-pecl-swoole4 developer files
                                    : (header)
php70-php-pecl-swoole.x86_64 : PHPs asynchronous concurrent distributed : 
                             : networking framework
php70-php-pecl-swoole-serialize.x86_64 : Fast and Small serialize
php70-php-pecl-swoole2.x86_64 : PHPs asynchronous concurrent distributed
                              : networking framework
php70-php-pecl-swoole4.x86_64 : PHPs asynchronous concurrent distributed
                              : networking framework


# select the lagest version to install
yum install -y php70-php-pecl-swoole4.x86_64


#3 Change the version of PHP


If you want to change to a higher version, E.g  PHP7.0->PHP7.2, below are the steps:


# Disable the php7.0
yum-config-manager --disable remi-php70   

# Enable the php7.2
yum-config-manager --enable remi-php72  

# Upgrade
yum update -y  

# Restart Nginx Nginx
systemctl restart nginx
systemctl restart php-fpm


You can't change to a lower version of PHP on this Image