Compile PHP 8.4 with xdebug from origin on Ubuntu 22.04
muras.eu 6 dni temu
It is easier than you think! Here is what I did on my Ubuntu 22.04 installation
sudo apt install-y pkg-config build-essential autoconf bison re2c libcurl4-gnutls-dev libxml2-dev libssl-dev libzip-dev libzip4
git clone https://github.com/php/php-src.git
cd php-src
# Take the latest PHP 8.4 tag
git checkout PHP-8.4.6
# Clean up the repository from any temporary build files.
git clean -Xdf# Build PHP
./buildconf
# With fewer useful extensions
./configure --disable-all--with-curl--with-iconv--enable-dom--with-libxml--enable-phar--enable-filter--with-openssl--with-zip--with-zlib
make -j4
You can then install PHP in the strategy with:
sudo make install
Or simply usage the executable, CLI is located under ./sapi/cli/php.
If you’re doing local development, then xdebug is simply a must, let’s add it as well.
git clone git://github.com/xdebug/xdebug.git
cd xdebug
# Let's make certain we're utilizing PHP we just compiled
/usr/local/bin/phpize
./configure --enable-xdebug
make
make install
To confirm you have the right PHP with xdebug review the output of: