Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Dev Section Modification & Patches
  • Search

[Vesta Install] Force Specific PHP Version as default (Ubuntu/Debian) Topic is solved

Section with modification and patches for Vesta
Post Reply
  • Print view
Advanced search
1 post • Page 1 of 1
codejp3
Posts: 3
Joined: Sat Dec 07, 2019 5:20 pm

Os: Ubuntu 17x
Web: nginx + php-fpm
[Vesta Install] Force Specific PHP Version as default (Ubuntu/Debian)
  • Quote

Post by codejp3 » Wed May 27, 2020 9:21 pm

I've never liked the limitations of PHP versions that seems to be inherent with VestaCP. The CentOS folks get the Remi repo to help remedy that, but there's no love for us Ubuntu/Debian users. There are several (outdated) tutorials for how to add PHP versions AFTER Vesta has been installed, but they're awkward and don't integrate with Vesta very well.

This "patch" will install the PHP version of YOUR CHOICE as the default, and integrate it with Vesta core as the default.


1.) Start with a fresh VPS/Server with the OS Installed (we're stuck at Ubuntu 18.04/Debian 9 for now until Vesta updates their repo to support newer versions).


2.) Make sure it's up-to-date

Code: Select all

sudo apt update && sudo apt dist-upgrade

3.) Use the Sury PPA to add newer versions of PHP

Code: Select all

sudo add-apt-repository ppa:ondrej/php
or if you don't have add-apt-repository available:

Code: Select all

sudo apt -y install lsb-release apt-transport-https ca-certificates wget && sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && sudo echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list

4.) Do another update/upgrade

Code: Select all

sudo apt update && sudo apt dist-upgrade

5.) Download the vst-install-[OS] script

Code: Select all

sudo cd /tmp; sudo wget http://vestacp.com/pub/vst-install-ubuntu.sh
*Note: change "ubuntu" to "debian" if you're using debian


6.) Replace the occurrences of "php-[SOMETHING]" with "php[VERSION]-[SOMETHING]"

Code: Select all

ver=7.4; sudo sed -i "s/php-cgi/php$ver-cgi/g; s/php-common/php$ver-common/g; s/php-curl/php$ver-curl/g; s/php-fpm/php$ver-fpm/g; s/php-mysql/php$ver-mysql/g; s/php-pgsql/php$ver-pgsql/g" /tmp/vst-install-ubuntu.sh 
*Note: change "7.4" to the version YOU want.


7.) Make the script executable

Code: Select all

sudo chmod +x /tmp/vst-install-ubuntu.sh
*Note: change "ubuntu" to "debian" if you're using debian


8.) Install VestaCP

Code: Select all

sudo bash vst-install-ubuntu.sh --nginx yes --phpfpm yes --apache no --named yes --remi no --vsftpd no --proftpd yes --iptables yes --fail2ban yes --quota yes --exim yes --dovecot yes --spamassassin yes --clamav no --softaculous no --mysql yes --postgresql yes
*Note: change "ubuntu" to "debian" if you're using debian
*Note2: change any options for your installation. You will be prompted for the domain/username/password. You may also have to add "--force" at the end if you run into install issues.


This will install VestaCP with the PHP version as default that YOU want. Something that, in my opinion, should be an installation option in the first place. There may actually be a legitimate reason Vesta has chosen not to allow for any PHP version options at install time, but I haven't found any yet.


This is a very crude but effective way to accomplish the task. I've considered altering the installer AND Vesta core to allow you to choose any version(s) you want, for any domain, at any time. I can't justify spending the time doing so right now, but if there is enough interest, then perhaps I will.

Let me know if you run into issues or have questions.
Top


Post Reply
  • Print view
1 post • Page 1 of 1

Return to “Modification & Patches”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password