Author Topic: readline not being installed with the php compilation  (Read 170 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
readline not being installed with the php compilation
« on: December 08, 2024, 10:39:49 PM »
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.

Offline
*****
Re: readline not being installed with the php compilation
« Reply #1 on: December 09, 2024, 03:26:56 AM »
Which version of php do you have set for CLI use?

Offline
*
Re: readline not being installed with the php compilation
« Reply #2 on: December 09, 2024, 03:40:22 AM »
PHP 8.3.14 (cli) (built: Dec  9 2024 03:06:51) (NTS)


Offline
*
Re: readline not being installed with the php compilation
« Reply #3 on: December 09, 2024, 04:44:58 AM »
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

Offline
***
Re: readline not being installed with the php compilation
« Reply #4 on: December 09, 2024, 12:09:21 PM »
Try to install libedit, libedit-devel:

Code: [Select]
yum install libedit-devel libedit
and then compile php again.

Offline
*
Re: readline not being installed with the php compilation
« Reply #5 on: December 09, 2024, 06:17:56 PM »
it is already installed.

Offline
***
Re: readline not being installed with the php compilation
« Reply #6 on: December 09, 2024, 06:34:00 PM »
Then try to install the extension readline manually:

Code: [Select]
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.
« Last Edit: December 09, 2024, 07:37:25 PM by cyberspace »

Offline
*
Re: readline not being installed with the php compilation
« Reply #7 on: December 09, 2024, 06:59:27 PM »
hi, thank you so much it worked!
but also i had to run command:
./configure
after command:
phpize

Offline
***
Re: readline not being installed with the php compilation
« Reply #8 on: December 09, 2024, 07:32:46 PM »
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.