Question

Updates to Droplet

I need to make some updates…not sure where or how to begin. Tutorials are pretty confusing.

  1. Increase upload limit beyond 2 MB. Can’t install .zip file, which is 2.5 MB. But Wordpress plugin is asking for 30 MB or more.

  2. Update PHP. Currently running PHP (7.0.32-0ubuntu0.16.04.1)

  3. Set up https. I have three subdomains. Main domain is on a different server.

This is the app’s requirements. https://www.imagely.com/docs/requirements/


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
December 1, 2021
Accepted Answer

Hi @jgwalter, I’ll try and answer the questions in a way the instructions should be followed.

You can’t upgrade your PHP version, you need to install a new one.

To be able to install a certain PHP version, in this case, 7.4 you’ll need to add a certain repository to your system

sudo apt-add-repository ppa:ondrej/php

Update the repository index.

sudo apt update

Install PHP 7.4 with the below command.

sudo apt install -y php7.4 php7.4-cli php7.4-common php7.4-fpm

To install extensions run

sudo apt install -y php7.4-mysql php7.4-dom php7.4-simplexml php7.4-ssh2 php7.4-xml php7.4-xmlreader php7.4-curl  php7.4-exif  php7.4-ftp php7.4-gd  php7.4-iconv php7.4-imagick php7.4-json  php7.4-mbstring php7.4-posix php7.4-sockets php7.4-tokenizer

The above are the required extensions for a simple WordPRess installation. Having said that it’s good to have these extensions as well.

sudo apt install -y php7.4-mysqli php7.4-pdo  php7.4-sqlite3 php7.4-ctype php7.4-fileinfo php7.4-zip php7.4-exif

That’s it, you now have the latest PHP version installed.

If you have Nginx, here is how you can activate it:

To activate PHP 7.4 on the server: Configure the PHP Processor

sudo nano /etc/php/7.4/fpm/php.ini

Find: cgi.fix_pathinfo Remove semi-colon and set 0

cgi.fix_pathinfo=0
sudo systemctl restart php7.4-fpm

Configure Nginx to Use the PHP Processor

sudo nano /etc/nginx/sites-available/default

Find out

location ~ \.php$ {
....
fastcgi_pass unix:/run/php/php7.0-fpm.sock; ---- Remove this line by commenting '#'

fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
sudo nginx -t
sudo systemctl reload nginx

You can now test php by using phpinfo() function or use php -v command into the terminal.

  1. Increasing the upload limit.

You’ll need to update your php.ini file:

/etc/php/7.4/nginx/php.ini 

If you are using Apache2:

/etc/php/7.4/apache2/php.ini 

You need to find and increase two directives -

  • post_max_size
  • upload_max_filesize Set them to whatever you need.
  1. In order to setup https, I’ll recommend using Certbot, it will create and configure the SSL certificates for you automatically.

Last words, if you are using Apache2 rather than Nginx, let me know and I’ll provide you steps to activate the latest PHP version on it.

@KFSys Thank you very much. Worked perfectly.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.