ubuntu
Windows&Linux下设置ngrok开机自启动
Deno 1.0
解决:关于docker闪退的问题
Windows 上的 Docker 引擎
文档管理 - 个人中心
Windows 10 安装 MySQL 8.0 指南
给Django添加Google Adsense 要求的ads.txt
docker命令
如何回滚WordPress插件(初学者版本控制) | ItBook
在Ubuntu 18.04上安装PHP 7.4
docker命令行
在PHP 7.3,Nginx,Apache,使用加密SSL,Cloud SQL(MySQL 5.7)的Google Cloud Platform上,将具有Nginx反向代理的WordPress安装到Ubuntu 18.04的Apache到Apache。
How to install mcrypt PHP module on Ubuntu 18.04 Linux
DjangoCMS手动安装
搭建Git服务器
Ubuntu Server 18.04 LTS 开机自动启动脚本 SVN自动启动 rc.local
通过禁用信号进行更快的DJANGO测试
gitBook的发布流程
ubuntu 18.04 怎么设置字体样式,调整字体大小
iptables过滤URL目标请求的小技巧
rsync复制文件的一些注意事项
如何设置crontab的时区?
本文档使用 MrDoc 发布
-
+
home page
在Ubuntu 18.04上安装PHP 7.4
Install PHP 7.4 on Ubuntu 18.04 阅读时间4分钟 Install PHP 7.4 on Ubuntu ![](/media//202005/Install-PHP-74-on-Ubuntu-1024x576_1590496234.jpg) Install PHP 7.4 on Ubuntu 18.04. This guide let you learn how install the latest PHP version 7.4 on your Ubuntu system or your Ubuntu server on any VPS or any Cloud or any Dedicated hosting and configure it with Apache and Nginx. The latest PHP 7.4 version is officially released on November 28th, 2019. It comes with a number of new features and a few incompatibilities that you should be aware of before upgrading from the previous version. This installation is tested on Google Cloud Platform with a Compute Compute Engine VM Instance. This set up will work on all Linux servers. # Prerequisites A Ubuntu server set up with sudo privileges. Completed the [initial Ubuntu server setup.](https://www.cloudbooklet.com/ubuntu-server-setup-on-google-cloud-platform/ "initial Ubuntu server setup.") If you are using Google Cloud Platform to install PHP you need the following steps to be done. A running Compute Engine, see the [Setting up Compute Engine Instance with Ubuntu 18.04](https://www.cloudbooklet.com/setting-up-google-cloud-compute-engine-instance/ "Setting up Compute Engine Instance with Ubuntu 18.04"). Here are some cloud hosting providers you can choose from with very low cost and free trial. # Getting Started Make sure your Ubuntu server is having the latest packages by running the following command. sudo apt update sudo apt upgrade This will update the package index and update the installed packages to the latest version. # Add PPA for PHP 7.4 Add the ondrej/php which has PHP 7.4 package and other required PHP extensions. sudo apt install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt update Once you have added the PPA you can install PHP 7.4. # Install PHP 7.4 for Apache Execute the following command to install PHP 7.4 sudo apt install php7.4 After the installation has completed, you can confirm the installation using the following command php -v # Install PHP 7.4 FPM for Nginx For Nginx you need to install FPM, execute the following command to install PHP 7.4 FPM sudo apt install php7.4-fpm After the installation has completed, confirm that PHP 7.4 FPM has installed correctly with this command php-fpm7.4 -v # Install PHP 7.4 Extensions Installing PHP extensions are simple with the following syntax. sudo apt install php7.4-extension_name Now, install some commonly used php-extensions with the following command. sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y # Configure PHP 7.4 Now we configure PHP for Web Applications by changing some values in php.ini file. For PHP 7.4 with Apache the php.ini location will be in following directory. sudo nano /etc/php/7.4/apache2/php.ini For PHP 7.4 FPM with Nginx the php.ini location will be in following directory. sudo nano /etc/php/7.4/fpm/php.ini Hit F6 for search inside the editor and update the following values for better performance. upload_max_filesize = 32M post_max_size = 48M memory_limit = 256M max_execution_time = 600 max_input_vars = 3000 max_input_time = 1000 Once you have modified your PHP settings you need to restart your Apache for the changes to take effect. # Configure PHP 7.4 FPM Pools PHP 7.4 FPM allows you to configure the user and group that the service will run under. You can modify these with these commands sudo nano /etc/php/7.4/fpm/pool.d/www.conf Change the following lines by replacing the www-data with your username. user = username group = username listen.owner = username listen.group = username Hit CTRL+X and Y to save the configuration and check if the configuration is correct and restart PHP. # Restart PHP 7.4 FPM Once you have updated your PHP FPM settings you need to restart it to apply the changes. sudo php-fpm7.4 -t sudo service php7.4-fpm restart Now you are having PHP 7.4 Installed and configured. Become a [Linux System Administrator](https://www.cloudbooklet.com/recommended/linux-admin "Linux System Administrator") and maintain virtual servers in a multi-user environment. # Upgrade to PHP 7.4 Once you have installed PHP 7.4 you need to upgrade to the latest installed version of PHP. Follow these steps to upgrade to[ PHP 7.4 with Apache or Nginx.](https://www.cloudbooklet.com/upgrade-php-version-to-php-7-4-on-ubuntu/ " PHP 7.4 with Apache or Nginx.") # Conclusion Now you have learned how to install PHP 7.4 on your Ubuntu server.
老糊糊
May 26, 2020, 8:33 p.m.
转发文档
Collection documents
Last
Next
手机扫码
Copy link
手机扫一扫转发分享
Copy link
Markdown文件
share
link
type
password
Update password