I need to install rdkafka on Ubuntu20 with Apache2 web server for a Laravel project. The PHP version is 7.2. I followed the documentation in Official Link and it finally shows
Installing '/usr/lib/php/20200930/rdkafka.so'
Now I see the warning
PHP Warning: PHP Startup: Unable to load dynamic library 'rdkafka.so' (tried: /usr/lib/php/20170718/rdkafka.so (/usr/lib/php/20170718/rdkafka.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/rdkafka.so.so (/usr/lib/php/20170718/rdkafka.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
The command php -i | grep extension_dir gives me
extension_dir => /usr/lib/php/20170718 => /usr/lib/php/20170718
It seems the rdkafka.so is installed inside a directory where PHP7.2 doesn't load its modules. If I manually move the rdkafka.so from /usr/lib/php/20200930 to /usr/lib/php/20170718 - as documentation suggested - it reports the error
PHP Warning: PHP Startup: Unable to load dynamic library 'rdkafka.so' (tried: /usr/lib/php/20170718/rdkafka.so (/usr/lib/php/20170718/rdkafka.so: undefined symbol: zend_string_init_interned), /usr/lib/php/20170718/rdkafka.so.so (/usr/lib/php/20170718/rdkafka.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PHP 7.2.34-24+ubuntu20.04.1+deb.sury.org+1 (cli) (built: Aug 26 2021 15:55:49) ( NTS )
The error undefined symbol: zend_string_init_interned shows up.
What shall I do?
Thanks in advance.
I solved the problem by install php7.2-dev which contains phpize7.2 and uninstalling php*-dev to make sure only phpize and phpize7.2 are installed. Then it installed the rdkafka in the right directory.
Related
I have been trying to use php in an Nginx server. I can't use Apache2 server. It's already in production. I have installed all the necessary requirements to run the duplicator (for Wordpress backup installation). But, it kept saying,
Support for the PHP mysqli extension is required. Please contact your hosting provider or server administrator to enable the mysqli extension. The detection for this call uses the function_exists('mysqli_connect') call.
Stack configuration:
Php: 7.2
Ubuntu: 18.04 L
Mysql: 5.7.32-0ubuntu0.18.04.1
Nginx: 1.14.0 (Ubuntu)
When I run sudo apt insall php-mysql, the result is
php-mysql is already the newest version (1:7.2+60ubuntu1).
Result of php -m | grep mysqli
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqlnd.so' (tried: /usr/lib/php/20170718/mysqlnd.so (/usr/lib/php/20170718/mysqlnd.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mysqlnd.so.so (/usr/lib/php/20170718/mysqlnd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/lib/php/20170718/mysqli.so (/usr/lib/php/20170718/mysqli.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mysqli.so.so (/usr/lib/php/20170718/mysqli.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /usr/lib/php/20170718/pdo_mysql.so (/usr/lib/php/20170718/pdo_mysql.so: undefined symbol: mysqlnd_allocator), /usr/lib/php/20170718/pdo_mysql.so.so (/usr/lib/php/20170718/pdo_mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
And finally since I am using php-fpm, snippets from php.ini file is
extension=mysqli <<< Current Configuration
;extension=/etc/php/7.2/mods-available/mysqli.ini <<< Tried this
;extension=mysqli.so <<< Tried This
Edit 1
Information from php info()
PHP Version 7.2.24-0ubuntu0.18.04.7
/etc/php/7.2/fpm/conf.d/20-mysqli.ini,
/etc/php/7.2/fpm/conf.d/20-pdo_mysql.ini,
I am currently running PHP 7.3.24-3+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 31 2020 16:59:59) ( NTS ) and I am trying to install sqlsrv and pdo_sqlsrv extensions. They extension install correctly and I followed the steps here https://learn.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver15#installing-the-drivers-on-ubuntu-1604-1804-and-2004 but pecl is installing the extensions in the 2019 folder instead of the 2018 folder. In my php info my API and API EXTENSIONS both are listed as the 2018. How do I go about updating what my API/EXTENSION point to in Ubuntu 18.04? Or is there another way to install sqlsrv and pdo_sqlsrv into the 2018 folder? Thanks!
I keep getting these errors when running php -v
PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv.so' (tried: /usr/lib/php/20180731/sqlsrv.so (/usr/lib/php/20180731/sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/sqlsrv.so.so (/usr/lib/php/20180731/sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlsrv.so' (tried: /usr/lib/php/20180731/pdo_sqlsrv.so (/usr/lib/php/20180731/pdo_sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/pdo_sqlsrv.so.so (/usr/lib/php/20180731/pdo_sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv.so' (tried: /usr/lib/php/20180731/sqlsrv.so (/usr/lib/php/20180731/sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/sqlsrv.so.so (/usr/lib/php/20180731/sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlsrv.so' (tried: /usr/lib/php/20180731/pdo_sqlsrv.so (/usr/lib/php/20180731/pdo_sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/pdo_sqlsrv.so.so (/usr/lib/php/20180731/pdo_sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
The issue I had was that I also had php 7.4 installed which I was not using, but phpize -v showed that the files were set to be placed in the 2019 folder. So I ran sudo apt-get purge php7.4-common then I re-installed sqlsrv and pdo_sqlsrv using pecl and following the link I posed above.
NOTE: I did not need php 7.4 so I was okay removing it.
THis is the update I get when I run the following command php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/curl.so' - /usr/lib/php/modules/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/dbase.so' - /usr/lib/php/modules/dbase.so: wrong ELF class: ELFCLASS32 in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/fileinfo.so' - /usr/lib/php/modules/fileinfo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/json.so' - /usr/lib/php/modules/json.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mysql.so' - /usr/lib/php/modules/mysql.so: wrong ELF class: ELFCLASS32 in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mysqli.so' - /usr/lib/php/modules/mysqli.so: wrong ELF class: ELFCLASS32 in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo.so' - /usr/lib/php/modules/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_mysql.so' - /usr/lib/php/modules/pdo_mysql.so: wrong ELF class: ELFCLASS32 in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_sqlite.so' - /usr/lib/php/modules/pdo_sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/phar.so' - /usr/lib/php/modules/phar.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/zip.so' - /usr/lib/php/modules/zip.so: cannot open shared object file: No such file or directory in Unknown on line 0
I'm trying to install Wordpress on a RHEL Machine. I initially had gotten mySQL up and running and then realized that my PHP was version 5.1.6. I added another repo, installed PHP 5.3 and removed the old php packages.
The error I get on a browser when I open localhost/wp-admin/install.php is:
Your PHP installation appears to be missing the MySQL extension which
is required by WordPress.
I have the package php-mysql.x86_64 installed and I can't figure out what the problem is.
I don't know what to do! Any help would be greatly appreciated.
Thanks.
Install required PHP libraries. RHEL installation command ( with all required modules for Wordpress):
sudo yum install php-bcmath php-cli php-common php-devel php-gd php-imap php-mbstring php-mcrypt php-mysqlnd php-odbc php-pdo php-pear php-pecl-geoip php-pecl-jsonc php-pecl-jsonc-devel php-pecl-zip php-pgsql php-process php-tidy php-xml php-xmlrpc
Install EPEL repos to update to latest PHP:
#CentOS 6 64Bit
sudo wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -ivh epel-release-6-8.noarch.rpm
sudo yum update php
EPEL repos installation process for other versions - How to Enable EPEL Repository for RHEL/CentOS 7.x/6.x/5.x
EDIT 1:
In order to disable other repositories, see and edit .repo files in /etc/yum.repos.d/ directory and set enabled=1 to enabled=0. After all don't forget to run:
yum clean all
So, I figured this out. The latest php version was installed. I was using 64 Bit RHEL and the libraries were in the /usr/lib64 folder instead of the /usr/lib folder. Once I changed that bit in the php.ini file, it ran like a charm. :)
When I run the command
php -v
this error comes up
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/module.so' - /usr/lib/php/modules/module.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.3.3 (cli) (built: Feb 22 2013 02:37:06)
This is cause by mcrypt extension.
Edit /etc/php.d/mcrypt.ini
and change
; Enable mcrypt extension module
extension=module.so
to this
; Enable mcrypt extension module
extension=mcrypt.so
Edit:
mini
If the directory /etc/php.d does not exist – it seems You don`t have php installed or file mcrypt.ini is in different location. Try work around.
I get this warning message in my php:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/sqlite.so' - /usr/lib64/php/modules/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
How should I fix that? Where can I get this sqlite.so file?
You don't need to get it. Just remove the line referencing the shared object.
cd /etc/php5
grep -rinH sqlite .
Since PHP 5.4 sqlite is only available via PECL.
If you want to get the library, try sudo apt-get install php-sqlite or yum install php-sqlite or similar.
Two ideas: (Re-) install php-sqlite on your machine or remove the line which loads the sqlite.so. Mostly done by an extra config in /etc/php5/conf.d/
If you don't have shell access, call you system administrator and give him that error message.
The .so file was removed in Ubuntu 11.10 (bug report here), however you can still install it manually...
Download the old package: http://packages.ubuntu.com/natty-updates/php5-sqlite
Extracts sqlite.so to the required directory
Change it's ownership to root:root
you must have sure sqlite installed
goto /etc/php.d and find sqlite.ini
you must somethong like : extension=mysql.so
mysql.so must be in : /usr/lib64/php/modules/
if not you must install it
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php54/5.4.30/lib/php/extensions/no-debug-non-zts-20100525/redis.so' - dlopen(/usr/local/Cellar/php54/5.4.30/lib/php/extensions/no-debug-non-zts-20100525/redis.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php54/5.4.30/lib/php/extensions/no-debug-non-zts-20100525/redis.so' - dlopen(/usr/local/Cellar/php54/5.4.30/lib/php/extensions/no-debug-non-zts-20100525/redis.so, 9): image not found in Unknown on line 0
I was getting this error/warning resolved it by uninstalling and installing redis
brew uninstall php54-redis
brew install php54-redis
I had the same warning when I wanted to install the symfony/security-bundle bundle in my Symfony 4 project:
composer require symfony/security-bundle
Here the warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib/php/modules/pdo_sqlite (/usr/lib/php/modules/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib/php/modules/pdo_sqlite.so (/usr/lib/php/modules/pdo_sqlite.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
I checked my /etc/php/php.ini file and I uncommented the line extension=pdo_sqlite line. I had to install the package php-sqlite via my package manager because the file pdo_sqlite.so must be present in the /usr/lib/php/modules/ folder:
pacman -S php-sqlite
After, I typed again the composer command and the warning disappeared. I hope my answer can help you.