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,
Related
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.
How to read Firebird 1.5 database with PHP 8 on Linux?
I have uncommented pdo_firebird extension in php.ini and restarted php8.0-fpm, but when checking modules with php -m, I'm getting the following error:
$ php -m
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_firebird' (tried: /usr/lib/php/20200930/pdo_firebird (/usr/lib/php/20200930/pdo_firebird: cannot open shared object file: No such file or directory), /usr/lib/php/20200930/pdo_firebird.so (/usr/lib/php/20200930/pdo_firebird.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Where can I find a compatible pdo_firebird.so file ? I couldn't find anything on the official website.
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.
I have installed the php-7.2.11 on linux successfully but forgot the extensions mysqli.
I made the mysqli.so and installed it on "/usr/local/lib/php/extensions/no-debug-non-zts-20170718".
If I run the "php -m",there is a mysqli, but when I start the php-fpm,by"
/usr/local/sbin/php-fpm -R",it will be failed.the message is :
Warning: PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20170718/mysqli.so (/usr/local/lib/php/extensions/no-debug-non-zts-20170718/mysqli.so: undefined symbol: mysqlnd_global_stats), /usr/local/lib/php/extensions/no-debug-non-zts-20170718/mysqli.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20170718/mysqli.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
I don't know why "Unable to load" and why what is the "mysqli.so.so". Do you have any suggestions?
The php-fmp configuration is usually located separately from php-cli and can be found in /etc/php/{version}/fpm/php.ini. Enable extension in it and restart php-fpm service
systemctl restart php-fpm.service
I have compiled version 5.4.14 of PHP on a linux system using the same configuration I had for a 5.4.13 version. I run the following PHP -i command and I get:
[root#localhost php-5.4.14]# php -i
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/20100525/fileinfo.so' - /usr/lib64/20100525/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/lib64/20100525/json.so' - /usr/lib64/20100525/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/lib64/20100525/phar.so' - /usr/lib64/20100525/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/lib64/20100525/zip.so' - /usr/lib64/20100525/zip.so: cannot open shared object file: No such file or directory in Unknown on line 0
Now I know that JSON is now part of the PHP core and there is no JSON.SO (I assume the same for the others). Is anyone aware of why this is a problem? I do not have any extension=XXXX.so lines in my php.ini file. I am compiling under Centos 6.4.
Got it -- A directory /etc/php.d was added. This contains a bunch of .ini files which are added to the processing of php.ini. The json.ini file, for example, simply says: extension=json.so
After spending too long looking for the answer, I happened to catch a line in the php -i output specifying the additional .ini directory. Hope this saves someone some time some day.