I am trying to install sqlsrv and pdo_sqlsrv on Ubuntu 16. I am getting this result
I have already installed MSSQL Express on Ubuntu. I just need to install these two drivers.
sudo pecl install pdo_sqlsrv
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/php_pdo_sqlsrv_7_nts.so' - /usr/lib/php/20160303/php_pdo_sqlsrv_7_nts.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/20160303/php_sqlsrv_7_nts.so' - /usr/lib/php/20160303/php_sqlsrv_7_nts.so: cannot open shared object file: No such file or directory in Unknown on line 0
Could not download from "http://pecl.php.net/get/pdo_sqlsrv-4.0.8.tgz", cannot download "pecl/pdo_sqlsrv" (File http://pecl.php.net:80/get/pdo_sqlsrv-4.0.8.tgz not valid (received: HTTP/1.1 503 Service Unavailable
))
Error: cannot download "pecl/pdo_sqlsrv"
Download failed
install failed
sudo pecl install sqlsrv
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/php_pdo_sqlsrv_7_nts.so' - /usr/lib/php/20160303/php_pdo_sqlsrv_7_nts.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/20160303/php_sqlsrv_7_nts.so' - /usr/lib/php/20160303/php_sqlsrv_7_nts.so: cannot open shared object file: No such file or directory in Unknown on line 0
Could not download from "http://pecl.php.net/get/sqlsrv-4.0.8.tgz", cannot download "pecl/sqlsrv" (File http://pecl.php.net:80/get/sqlsrv-4.0.8.tgz not valid (received: HTTP/1.1 503 Service Unavailable
))
Error: cannot download "pecl/sqlsrv"
Download failed
install failed
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.
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.
While upgrading php from php.5.3.25 to php5.6.7. got the below errors:
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/applications/php/lib/php/extensions/no-debug-non-zts-20131226/memcache.so' - /opt/applications/php/lib/php/extensions/no-debug-non-zts-20131226/memcache.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 '/opt/applications/php/lib/php/extensions/no-debug-non-zts-20131226/ffmpeg.so' - /opt/applications/php/lib/php/extensions/no-debug-non-zts-20131226/ffmpeg.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 '/opt/applications/php/lib/php/extensions/no-debug-non-zts-20131226/mcrypt.so' - /opt/applications/php/lib/php/extensions/no-debug-non-zts-20131226/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
The error is because you are trying to load those extensions which are not installed.Try this for installation in Ubuntu
sudo apt-get install memcached
sudo apt-get install mcrypt
sudo apt-get install mysql
FOR MORE REFERENCE
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. :)