I have a problem with building the package for PHP 7.3 from git. At the moment I am using Ubuntu 16.04 with utdatet php 7.0.x. (It's impossible to upgrade Ubuntu 16.04 to 18.04 at my VPS, because it crashes at boot. I only have Virtuozzo to debug and I can't find the point where it crashes, so upgrading to 18.04 isn't an option yet.)
My steps so far:
I have installed all programs for build, (git, build essential, libtool, bison and re2c).
I cloned the git from GitHub with:
git clone https://github.com/php/php-src.git
Then I selected the branch I want:
git checkout PHP-7.3
Then I ran:
./buildconf
What is the next step?
I need the following packages:
php7.3
libapache2-mod-php7.3
php7.3-mysql
mysql-server
I didn't search for a PPA, because I wanted to do it on my own in order to learn by doing it.
Best Answer
Install dependencies.
Ubuntu 16.04:
Ubuntu 18.04
Ubuntu 20.04
So you don't overwrite any existing PHP installs on your system, install PHP in your home directory. Create a directory for the PHP binaries.
Download the PHP 7.3 from GitHub, decompress it, then change directories using
cd
to the new directory. You can also download PHP 7.3 from php.net/downloads.php and the installation instructions are exactly the same. Ordinarily this would be the preferred way of downloading PHP 7.3, but I'm using PHP 7.3 from https://github.com/php/ in this answer instead in order to match the PHP 7.3 archive that is asked about in the question.Configure PHP. Remove any options you don't need (like MySQL or Postgres (--with-pdo-pgsql))
Probably you won't need to remove any of the options except for
--with-pdo-pgsql=/usr/bin/pg_config
if PostgreSQL isn't installed. If you don't remove an option that is specific to a package that isn't installed, then this command will return an error message that tells you what option must be removed so that the command will run successfully.Compile the binaries:
When make is finished you will see the following message:
Warning:
make test
takes a long time to finish, so don't run it when the computer is busy.Copy the PHP.ini file to the install directory
Rename two files.
Create symbolic links for your for your binary file.
Link your local PHP to the php command. You will need to logout then log back in for php to switch to the local version instead of the installed version from the default Ubuntu repositories.
Start PHP-FPM
If you run the above command as normal user without sudo, it will show the following notices:
Source: The Install file in php-src-master directory from https://github.com/php/php-src.git contains a link to https://php.net/install from which source these instructions were revised. In addition to several small revisions I added information about how to install PHP 7.3 locally in your home directory without requiring root permissions.