readline not being installed with the php compilation

Started by victorgomes, December 08, 2024, 10:39:49 PM

Previous topic - Next topic

victorgomes

when installing php version 8.3.14 using php switch version the extensions readline is not being installed.
do you guys know how to solve it?

php -a

SourceGuardian requires Zend Engine API version 420220829.
The Zend Engine API version 420230831 which is installed, is newer.
Contact SourceGuardian Ltd. at https://www.sourceguardian.com/ for a later version of SourceGuardian.

Interactive shell (-a) requires the readline extension.

overseer


victorgomes

PHP 8.3.14 (cli) (built: Dec  9 2024 03:06:51) (NTS)


victorgomes

when running command:
cat /var/log/php-rebuild.log | grep readline

i got these informations:

Package readline-devel-8.1-4.el9.x86_64 is already installed.
    Link pcre2test with libreadline .... : no
checking for phpdbg readline support... no
checking for phpdbg and readline integration... disabled
checking for libedit readline replacement... no
checking for readline support... no

cyberspace

Try to install libedit, libedit-devel:

yum install libedit-devel libedit

and then compile php again.


cyberspace

#6
Then try to install the extension readline manually:


cd /usr/local/src/
wget https://www.php.net/distributions/php-8.3.14.tar.gz
tar -xvzf php-8.3.14.tar.gz
cd php-8.3.14/ext/readline
phpize
./configure
make
make install
echo "extension=readline.so" > /usr/local/php/php.d/readline.ini


Make sure there are no errors and the file readline.so exists in /usr/local/lib/php/extensions/no-debug-non-zts-XXXXXXXX/

If everything is ok then check 'php -a' again.

If you get some errors then show us the errors.

victorgomes

hi, thank you so much it worked!
but also i had to run command:
./configure
after command:
phpize

cyberspace

Yes, `configure` is necessary to perform the installation. Sorry for that. I was in hurry. Updated my previous post.

Also, in case you update PHP using php switch then make sure to update readline if it isn't updated automatically by php switch.