You can check it by creating a small php file in your web root with the following contents and visiting it in your web browser: Sudo systemctl restart php7.4-fpm sudo systemctl restart nginx Īgain, look in the Perfect Server guides for your version and webserver for the correct command here.Ĭongratulations, you should now be running on the PHP version you want. Restart PHP-FPM and your webserverįor example if your web server is nginx, you would execute: Sudo rm /etc/alternatives/php sudo ln -s /usr/bin/php 5.6 /etc/alternatives/php Ĭonfirm by running php -v once more. If the version number reported is different than the one you want, execute the following command replacing the version number with the one you want: First check what version the cli is using right now by executing: Make sure PHP-CLI points to the right PHP versionĮspecially if you are downgrading, you need to check that php-cli is pointing to the correct version. SetHandler "proxy:unix:/run/php/php 7.4-fpm.sock|fcgi://localhost"Ĥ. Look for this line and replace the PHP version number with the one you want: Update your web server configuration to point to the correct PHP versionįor Nginx you would edit /etc/nginx/sites-available/webdock. Look for this line and replace the PHP version number with the one you want:įastcgi_pass unix:/var/run/php/php 7.4-fpm.sock įor Apache you would edit /etc/apache2/sites-available/nf and /etc/apache2/sites-available/nf. Make sure PHP configuration for your target version is updatedĪgain, here you copy/paste the commands from the Perfect Server guide in the sections titledģ. In general, please copy/paste commands from our Perfect Server guides as these are always kept up to date, and commands shown here are for example purposes only!įinally, you should install php-fpm in the target version you want: Sudo apt-add-repository ppa:ondrej/php -y If you get an error claiming the appropriate PHP packages cannot be found, then you are on a really old version of our stacks which does not have the ondrej/php PPA added. Sudo apt install -y php7.4-cli php7.4-dev php7.4-pgsql php7.4-sqlite3 php7.4-gd php7.4-curl php7.4-memcached php7.4-imap php7.4-mysql php7.4-mbstring php7.4-xml php7.4-imagick php7.4-zip php7.4-bcmath php7.4-soap php7.4-intl php7.4-readline php7.4-common php7.4-pspell php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-opcache php7.4-apcu For example say you want to use PHP7.4 you would go to the 7.4 guide and find the section titled Install PHP7.4 and common PHP packages - the command you are looking for would look something like: Next, install the packages - the packages you want are listed on our Perfect Server stack pages. If it prompts you what to do with config files, usually you should just go with the default option and leave the current config as-is. ![]() First make sure your system is up to date: ![]() You need to make sure the correct packages are available on your system for the PHP version you want. Make sure packages for your target version of PHP are installed Point PHP CLI to the correct PHP versionīefore performing this operation, it is always a good idea to take a snapshot of your server in case something goes wrong! 1.Update your web server configuration to point to the correct PHP version.Update any configuration for that PHP version.Ensure the php packages for the version you want are installed.Upgrading or Downgrading PHP versions on a Webdock stack is essentially the same procedure.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |