If you have a question or facing any problems, feel free to leave a comment. Now you have learned how to install and configure PHP-FPM with Nginx on your Ubuntu server. To restart Nginx and PHP-FPM, run the commands below sudo php-fpm7.3 -t Step 6: Restart PHP-FPM and NginxĪfter installing PHP and related modules, all you have to do is restart PHP-FPM and Nginx to reload PHP configurations. max_execution_time = 180Īfter making the change above, save the file and close out. Below are recommended values being great settings to apply in your environments. Make the changes on the following below lines in opened file and save. The default PHP configuration file is at /etc/php/7.3/fpm/php.ini or /etc/php/7.4/fpm/php.ini and if we want to modify the default PHP configuration, open file by using the following command: sudo nano /etc/php/7.3/fpm/php.ini Step 5: Configure PHP 7.3-FPM/PHP 7.4-FPM Now, PHP 7.3-FPM has been installed on your Ubuntu server. apt policy php7.3-cli and output will be php7.3-cli: You can confirm the installed version of any PHP extension using apt policy command i.e. sudo apt install php7.4-common php7.4-zip php7.4-curl php7.4-xml php7.4-xmlrpc php7.4-json php7.4-mysql php7.4-pdo php7.4-gd php7.4-imagick php7.4-ldap php7.4-imap php7.4-mbstring php7.4-intl php7.4-cli php7.4-tidy php7.4-bcmath php7.4-opcache Install the most commonly used PHP extensions using the following command for PHP 7.3: sudo apt install php7.3-common php7.3-zip php7.3-curl php7.3-xml php7.3-xmlrpc php7.3-json php7.3-mysql php7.3-pdo php7.3-gd php7.3-imagick php7.3-ldap php7.3-imap php7.3-mbstring php7.3-intl php7.3-cli php7.3-tidy php7.3-bcmath php7.3-opcache With Zend OPcache v7.4.28, Copyright (c), by Zend Technologies Step 4: Install PHP Extensions Zend Engine v3.4.0, Copyright (c) Zend Technologies In case if you have installed PHP 7.4-FPM, following will be output: PHP 7.4.28 (cli) (built: 16:06:35) ( NTS ) Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies You can use php -v the command to check the PHP version installed on your server and output will be PHP 7.3.11-1+ubuntu19.10.1++6 (cli) (built: 21:34:37) ( NTS ) Sudo apt install php7.4-fpm Step 3: Check the PHP installation Install PHP 7.3-FPM on Ubuntu using the following command: sudo apt install php7.3-fpm Sudo apt update Step 2: Install PHP 7.3-FPM/PHP 7.4-FPM For Nginx Sudo add-apt-repository -y ppa:ondrej/php PHP can be installed using Ondřej Surý PPA, so install the software-properties-common package, add the ondrej PPA and update your sources using the following commands: sudo apt-get install software-properties-common Logged in as a root with sudo privileges.It does not store any personal data.Here is how you can install PHP-FPM with Nginx on Ubuntu. The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. The cookie is used to store the user consent for the cookies in the category "Performance". This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. The cookies is used to store the user consent for the cookies in the category "Necessary". The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". The cookie is used to store the user consent for the cookies in the category "Analytics". These cookies ensure basic functionalities and security features of the website, anonymously. Necessary cookies are absolutely essential for the website to function properly. Restart Apache server sudo systemctl restart apache2 apt -y install php8.1-fpm libapache2-mod-fcgidĪ2enmod proxy_fcgi setenvif & sudo a2enconf php8.1-fpm apt -y install software-properties-common & sudo add-apt-repository ppa:ondrej/php PHP-FPM If you want to install PHP 8.1, you need to use the repository from Ondřej Surý, the lead developer on PHP and Debian. Press “Esc” to switch back to command mode.Īdd a new.sudo su -Īpache rewrite allow you setup the routing which is good for SEO. To run a web server, you need to install Apache first. If you do not have a server, you may check out Setup EC2 with Instance Connect ( ) The first thing to do in a new system is to update our repositories in order to make them up to date.
0 Comments
Leave a Reply. |