Unable to connect mysql with php7 in Linux 7


 
Thread Tools Search this Thread
Top Forums Programming Unable to connect mysql with php7 in Linux 7
# 1  
Old 05-28-2018
Unable to connect mysql with php7 in Linux 7

I am getting below error on executing the code.
Code:
<
<?php

$dbname = 'upload_ui';
$dbuser = 'nad';
$dbpass = 'nad';
$dbhost = '10.196.84.192';

$link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");

  }
?>
-->

error:
Code:
<
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/bin/mysql/' (tried: /usr/bin/mysql/ (/usr/bin/mysql/: cannot open shared object file: Not a directory), /usr/lib64/php/modules//usr/bin/mysql/.so (/usr/lib64/php/modules//usr/bin/mysql/.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/bin/mysql' (tried: /usr/bin/mysql (/usr/bin/mysql: cannot dynamically load executable), /usr/lib64/php/modules//usr/bin/mysql.so (/usr/lib64/php/modules//usr/bin/mysql.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/mysql' (tried: /usr/lib64/mysql (/usr/lib64/mysql: cannot read file data: Is a directory), /usr/lib64/php/modules//usr/lib64/mysql.so (/usr/lib64/php/modules//usr/lib64/mysql.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' (tried: /usr/lib64/php/modules/mysqli (/usr/lib64/php/modules/mysqli: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/mysqli.so (/usr/lib64/php/modules/mysqli.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 'php_mysqli' (tried: /usr/lib64/php/modules/php_mysqli (/usr/lib64/php/modules/php_mysqli: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/php_mysqli.so (/usr/lib64/php/modules/php_mysqli.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Parse error:  syntax error, unexpected '}', expecting end of file in /root/a.php on line 10
 -->

Any help would be appreciated


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 05-28-2018 at 10:38 AM.. Reason: Added CODE tags.
# 2  
Old 05-28-2018
Is that a newly occurring error? Did the script work before? Is mysql installed? In what location?


At least the last error line is self- explanatory: I see an unpaired } in your code snippet.
# 3  
Old 05-28-2018
Yes it is new server and setup i installed mysql ,PHP7.2 and apache on LINUX 7.3

Code:
[root@~]# php a.php
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/lib64/php/modules/mysqli.so (/usr/lib64/php/modules/mysqli.so: undefined symbol: mysqlnd_global_stats), /usr/lib64/php/modules/mysqli.so.so (/usr/lib64/php/modules/mysqli.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

agian same error
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Unable to connect to internet

Hello, I just installed CentOS 7 (Server with GUI) and guess what I could install Virtual Box Guest additions without installing any extra package/software which is great news ! Now bad news or not so great news. My Host OS is Windows 10, Virtual Box is the virtualization software. CentOS7-1... (0 Replies)
Discussion started by: bluemind2005
0 Replies

2. Cybersecurity

When i start CSF i cant connect VPS or download any data into it It appears i cant connect Linux VP?

It appears i cant connect linux VPS server via SSH or i cant SCP any file to it and i cant wget any file TO it (from inside it) while CSF (Config Server Firewall, LFD is running. Just after isntall in default configuration and after changing TESTING mode to LIVE mode. Trying to wget & install... (1 Reply)
Discussion started by: postcd
1 Replies

3. Red Hat

Unable to connect "Reliance Netconnect" on Redh Hat Linux 5

Hi Friends, Can someone help me with below issue , thanks. Subject : Unable to configure "Reliance NetConnect" on RHEL 5 Here some helpful information : # lsusb Bus 001 Device 001: ID 0000:0000 Bus 001 Device 002: ID 8087:0020 Bus 001 Device 003: ID 192f:0416 Bus 002 Device... (0 Replies)
Discussion started by: arunraj192
0 Replies

4. Emergency UNIX and Linux Support

Unable to connect to oracle in red hat linux

Hi Gurus, I have installed the oracle xpress 10g edition in my red hat linux and saw the message that it has been installed successfully ,but after that I started the database by going through application->database->start database and after that i open the sql prumt but when i tried to connect... (18 Replies)
Discussion started by: sanjay.login
18 Replies

5. Debian

Connect MySQL databse to debian

Hello, I wont to connect a MySQL database to debian: I have installed libmyodbc package and after i have configured /etc/odbcinst.ini: Description = MySQL driver Driver = /usr/lib/odbc/libmyodbc.so Setup = /usr/lib/odbc/libodbcmyS.so and /etc/odbc.ini : Description =... (0 Replies)
Discussion started by: linux31
0 Replies

6. UNIX for Dummies Questions & Answers

Connect MySQL database from Unix

How to connect a MySQL database from unix using unix shell scripting ( people are using perl scrpt to connect the same database). I want to access a MySQL database through a shell script (4 Replies)
Discussion started by: apsprabhu
4 Replies

7. Shell Programming and Scripting

connect to MySQL from Perl using DBI

Hi, I want to connect perl with the mysql to select and so on but the connection don't work code #!/usr/bin/perl BEGIN { # PERL MODULES WE WILL BE USING use DBI; $dbh = DBI->connect('DBI:mysql:C:\Program Files\MySQL\MySQL Server 5.0\data\db1','','pass') or die $DBI::errstr;} #... (1 Reply)
Discussion started by: eng_shimaa
1 Replies

8. Shell Programming and Scripting

Trying to connect MYSQL server from HP-UX

Hi everyone, I have an urgent requirement to get some table data from Linux-MYSQL server from HP-UX with oracle database.Is there any way we can get connected through Shell script from HP-UX and issue select on mysql to get some table data? Please help me out. (7 Replies)
Discussion started by: kashik786
7 Replies

9. Solaris

Unable to connect to Internet

Hi friends recently i have installed SXDE 1/08 into my machine,and i installed wifi driver also its working fine,Recently i was unable to connect to Internet,I have not changed any configurations and any installations,thing is that i got my iwk0 interface is UP and IP address also and i can... (6 Replies)
Discussion started by: srinivas2828
6 Replies

10. HP-UX

Unable to connect to HP-UX 11.11 via eXceed 7.1

Hello HP-UX Gurus, I am having issues trying to start an x-session via eXceed 7.1. When I bring up eXceed via XDMCP Braodcast I see the host name and IP Address but when I try to connect the X window does not come up. I made the modification to the following file “/etc/dt/config/Xaccess”... (2 Replies)
Discussion started by: smokie
2 Replies
Login or Register to Ask a Question