Glam Prestige Journal

Bright entertainment trends with youth appeal.

I downloaded php-7.4.11.tar.gz for the installation manual, but after extracting and entering make, the following message is displayed in the terminal:

make: *** No targets specified and no makefile found. Stop.

~/php-7.4.11$ ls
appveyor buildconf config.nice docs libs Makefile.objects php.ini-production sapi TSRM Zend
azure buildconf.bat configure ext LICENSE NEWS README.md scripts UPGRADING
azure-pipelines.yml CODING_STANDARDS.md configure.ac EXTENSIONS main pear README.REDIST.BINS tests UPGRADING.INTERNALS
build config.log CONTRIBUTING.md include Makefile.fragments php.ini-development run-tests.php travis win32
4

1 Answer

In order to have a version of PHP 7.4 greater than 7.4.3, you will need to use Ondřej Surý's PPA. This will give you 7.4.27 if you are running Ubuntu 18.04, 20.04, 21.04, or 21.10. Fortunately, it's not too difficult to do.

WARNING: You need to understand that by following these steps, the web server will be OFFLINE during the PHP version change. You will be uninstalling 7.4.3 and installing 7.4.27, which does take a couple of minutes. If you are doing this on a production machine that does not have any spare for maintenance, your visitors will need to understand the error(s) they see are temporary.

With that out of the way, let's get started.

If you are updating an existing workstation/server:

  1. Open Terminal or connect to the server where you need 7.4.27

  2. Stop Apache:

    sudo service apache2 stop

    Note: This technically is not required, but it's just "cleaner".

  3. Uninstall all PHP packages on your machine:

    sudo apt purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`

    Source

    NOTE: Read the packages that are going to be uninstalled and be sure that the list is correct before continuing. If you do not agree with the list, then STOP.

  4. Once the packages are removed, clean apt:

    sudo apt clean 

Now that PHP has been removed from the system, let's continue.

Installing Ondřej Surý's version of PHP:

  1. Open Terminal or connect to the server where you need 7.4.27

  2. Ensure Apache is not running:

    sudo service apache2 stop

    Note: This technically is not required, but it's just "cleaner". Of course, if Apache isn't installed, you don't need to do this.

  3. Add the appropriate PPA:

    sudo add-apt-repository ppa:ondrej/php
  4. Update apt:

    sudo apt update
  5. Install PHP 7.4.27:

    sudo apt install php7.4

    Note: While the package states 7.4, this will give you 7.4.27-1+ubuntu20.04.1+deb.sury.org+1 on 20.04 (as of this writing).

    Of course, feel free to add any other PHP packages that you may need, but keep in mind that you must specifically specify the major and minor versions for every additional package. For example:

    sudo apt install php7.4 php7.4-json php7.4-xml php7.4-mbstring ...
  6. Once complete, confirm the installed version:

    $ php -v
    PHP 7.4.27 (cli) (built: Nov 25 2021 23:16:22) ( NTS )
    Copyright (c) The PHP Group ...
  7. Start/Restart Apache (if that's the web server you're using):

    sudo service apache2 start

Now you're using a fully up-to-date version of PHP 7.4.x, which will receive security updates until November 28, 2022. Hopefully by then there will be a plan for you to upgrade to PHP 8.0 or 8.1.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy