To update WordPress CMS core, plugin and theme translations the following commands can be used:
# wp language plugin --all update # wp language theme --all update # wp language core update
web development and system administration of Linux
To update WordPress CMS core, plugin and theme translations the following commands can be used:
# wp language plugin --all update # wp language theme --all update # wp language core update
All packages should be installed as a root administrator user.
Before we install anything new on a server, you should update your server packages:
# apt-get update && apt-get upgrade
Next, to install PHP 7.4 on Ubuntu 20.04, just run the following command:
# apt-get install php
To verify if PHP is installed, run the following command:
# php -v
These are the most common PHP 7.4 modules often used by php applications. You may need more or less, so check the requirements of the software you’re planning to use:
# apt-get install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml
PHP 8.1 is the newest PHP version released on 25 Nov 2021. You can start using it now. These are the instructions on how to install it on Ubuntu 22.04 or Ubuntu 20.04 (or any other Ubuntu).
To install PHP 8.0 you’ll need to use a third-party repository. We’ll use the repository by Ondřej Surý that we previously used.
First, make sure you have the following package installed so you can add repositories:
# apt-get install software-properties-common
Next, add the PHP repository from Ondřej:
# add-apt-repository ppa:ondrej/php
And finally, update your package list:
# apt-get update
After you’ve added the repository, you can install PHP 8.1 with the following command:
# apt-get install php8.1
This command will also install some additional packages:
And that’s it. To check if PHP 8.1 is installed on your server, run the following command:
# php -v
You may need additional packages and modules depending on your applications. The most commonly used modules can be installed with the following command:
# apt-get install php8.1-fpm php8.1-curl php8.1-dev php8.1-gd php8.1-mbstring php8.1-zip php8.1-mysql php8.1-xml
If you have multiple PHP versions installed on your Ubuntu server, you can change what version is the default one.
To set PHP 8.1 as the default, run:
# update-alternatives --set php /usr/bin/php8.1
To create a git patch file from the uncommitted changes in the current working directory use command:
git diff > filename.patch
In case some part of the work you’re doing are new files that are untracked and won’t be in your git diff output. So, one way to do a patch is to stage everything for a new commit (git add each file, or just git add .) but don’t do the commit, and then run:
git diff --cached > filename.patch
You can use the ‘binary’ option if you want to add binary files to the patch (e.g. mp3 files):
git diff --cached --binary > filename.patch
You can later apply the patch by running:
git apply filename.patch
Read more options at https://stackoverflow.com/questions/5159185/create-a-git-patch-from-the-uncommitted-changes-in-the-current-working-directory.
To undo last commit in git you can use the following command below:
$ git reset HEAD~
To display changes in the particular commit you can use the following command:
# git show COMMIT_HASH
You can find commit hash using one of the following commands:
# git log
… or by commit message text:
# git log --all --grep="commit comment message"
You can also find more information in git show documentation.
If you need to change current value of auto_increment for table you could use the following SQL query:
ALTER TABLE `table_name` AUTO_INCREMENT=1001;
If you need to find some commits by commit message text you could use the command below:
git log --all --grep='message text to search for'
I’ve completed Pimcore CMS Senior Developer Certification.
To downgrade composer to version 1 the following command should be used:
$ composer self-update --1
To make tar archive without .git folder or any other version control systems –exclude-vcs option can be used for tar.
Example tar command could be:
$ tar --exclude-vcs -cpjf ~/backup__no_vcs__$(date +'%Y-%m-%d_%H-%M').tar.bz2 ./