PHP Fatal error: Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50

I have new installed webserver, when I tried to start the http server, it gave me error as below. please advise.

[root@point logs]# tail -20 error_log
[Tue Apr 21 15:57:29 2015] [notice] Digest: generating secret for digest authentication ...
[Tue Apr 21 15:57:29 2015] [notice] Digest: done
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/msql.so' - /usr/lib64/php/modules/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Tue Apr 21 15:57:29 2015] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips mod_wsgi/3.2 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Tue Apr 21 15:57:39 2015] [client 198.51.140.156] PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50, referer: http://point.lacare.org/unsubscribe.php
[Tue Apr 21 15:57:52 2015] [client 198.51.140.156] PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50, referer: http://point.lacare.org/unsubscribe.php
[Tue Apr 21 16:19:28 2015] [client 198.51.140.156] PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50, referer: http://point.lacare.org/unsubscribe.php
[Tue Apr 21 16:19:38 2015] [client 198.51.140.156] PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50, referer: http://point.lacare.org/unsubscribe.php
[Tue Apr 21 16:19:40 2015] [notice] caught SIGTERM, shutting down
[Tue Apr 21 16:19:41 2015] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Tue Apr 21 16:19:41 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Apr 21 16:19:41 2015] [notice] Digest: generating secret for digest authentication ...
[Tue Apr 21 16:19:41 2015] [notice] Digest: done
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/msql.so' - /usr/lib64/php/modules/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Tue Apr 21 16:19:41 2015] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips mod_wsgi/3.2 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Tue Apr 21 16:19:41 2015] [client 198.51.140.156] PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50, referer: http://point.lacare.org/unsubscribe.php
[Tue Apr 21 16:19:42 2015] [client 198.51.140.156] PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50, referer: http://point.lacare.org/unsubscribe.php
[Tue Apr 21 16:19:43 2015] [client 198.51.140.156] PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50, referer: http://point.lacare.org/unsubscribe.php
[Tue Apr 21 16:19:43 2015] [client 198.51.140.156] PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50, referer: http://point.lacare.org/unsubscribe.php
[Tue Apr 21 16:19:55 2015] [client 198.51.140.156] PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50, referer: http://point.lacare.org/signup.php
[root@point logs]#
Jason YuAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
Dave BaldwinFixer of ProblemsCommented:
I have never known what "msql.so" was except that it is Not 'mysql.so' or 'mysqli.so' which would be the drivers for MySQL.  So start by commenting out the 'msql.so' extension in 'php.ini' and enabling the 'mysql.so' extension.  Note that you should also enable the 'mysqli.so' extension because the 'mysql.so' driver is going obsolete and you will soon have to rewrite your code to use 'mysqli' instead.
0
 
Ray PaseurCommented:
For obvious reasons (deprecation) MySQL is no longer part of the standard PHP installation.  It has to be installed separately.  The online man pages explain how.

Some guidance on getting from MySQL to one of the supported extensions:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/A_11177-PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
Jason YuAuthor Commented:
Hi, Dave and Ray, thank you two for quick respond. I checked the php.ini file and didn't find any line includes 'mysql.so' extension. I was wondering if this php.ini was modified incorrectly.

Here is the file in the attachment.
php.ini.txt
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
Dave BaldwinFixer of ProblemsCommented:
From your 'php.ini' file...
; Note: packaged extension modules are now loaded via the .ini files
; found in the directory /etc/php.d; these are loaded by default.
It looks like you are using Ubuntu (which I have) or maybe Debian.  You may have to add the 'mysql' and 'mysqli' extensions thru the Package Manager so they end up in the right place.
0
 
Jason YuAuthor Commented:
This is strange because the OS is RHEL. My coworker installed PHP and MySQL package, are they the right packages?

How could I know if the packages he installed are for RHEL or Ubuntu/Debian?

thanks.

[root@point php.d]# cat /etc/*-release
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Red Hat Enterprise Linux Server release 6.6 (Santiago)
Red Hat Enterprise Linux Server release 6.6 (Santiago)
[root@point php.d]#
0
 
Jason YuAuthor Commented:
Here is the content under /etc/php.d directory. How could I install mysql module into this directory?

thanks.


root@point php.d]# pwd
/etc/php.d
[root@point php.d]# ls -alth
total 72K
drwxr-xr-x. 99 root root  12K Apr 22 09:18 ..
drwxr-xr-x.  2 root root 4.0K Apr  6 11:05 .
-rw-r--r--.  1 root root   49 Sep 10  2014 curl.ini
-rw-r--r--.  1 root root   47 Sep 10  2014 dom.ini
-rw-r--r--.  1 root root   57 Sep 10  2014 fileinfo.ini
-rw-r--r--.  1 root root   45 Sep 10  2014 gd.ini
-rw-r--r--.  1 root root   49 Sep 10  2014 json.ini
-rw-r--r--.  1 root root   47 Sep 10  2014 pdo.ini
-rw-r--r--.  1 root root   61 Sep 10  2014 pdo_sqlite.ini
-rw-r--r--.  1 root root   49 Sep 10  2014 phar.ini
-rw-r--r--.  1 root root   55 Sep 10  2014 sqlite3.ini
-rw-r--r--.  1 root root   49 Sep 10  2014 wddx.ini
-rw-r--r--.  1 root root   59 Sep 10  2014 xmlreader.ini
-rw-r--r--.  1 root root   59 Sep 10  2014 xmlwriter.ini
-rw-r--r--.  1 root root   47 Sep 10  2014 xsl.ini
-rw-r--r--.  1 root root   47 Sep 10  2014 zip.ini
[root@point php.d]#
0
 
Dave BaldwinFixer of ProblemsCommented:
You probably have to be 'root'.  The commands from the command line are...
yum install php php-mysql
yum install php-mysqli

Open in new window

0
 
Jason YuAuthor Commented:
[root@point php.d]# yum install php php-mysql
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Nothing to do
[root@point php.d]# yum install php-mysqli
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
No package php-mysqli available.
Error: Nothing to do
[root@point php.d]#
0
 
Jason YuAuthor Commented:
do I need buy rehl subscription to use yum?
0
 
Dave BaldwinFixer of ProblemsCommented:
I don't know.  I've got CentOS which is a free version of RedHat.  But the messages above seem to say that you do.
0
 
Jason YuAuthor Commented:
when I check the installed package on the system, it shows php and php-mysql are installed. But "php-mysqli" is not.


[root@point yum.repos.d]# rpm -qa | grep php
php-gd-5.3.3-38.el6.x86_64
php-cli-5.3.3-38.el6.x86_64
php-pear-1.9.4-4.el6.noarch
php-xml-5.3.3-38.el6.x86_64
php-mysql-5.6.6-nginx_1_Oso.x86_64
php-5.3.3-38.el6.x86_64
php-pdo-5.3.3-38.el6.x86_64
php-common-5.3.3-38.el6.x86_64
[root@point yum.repos.d]# rpm -qa | grep php-mysql
php-mysql-5.6.6-nginx_1_Oso.x86_64
[root@point yum.repos.d]# rpm -qa | grep php-mysqli
[root@point yum.repos.d]#
0
 
Dave BaldwinFixer of ProblemsCommented:
I think this "php-mysql-5.6.6-nginx_1_Oso.x86_64" is the wrong version.  On my CentOS 6.6 system I have "php-mysql-5.3.3-40-el6_6 (686)" and I think that is the one you need too.  Although it might be "php-mysql-5.3.3-40-el6.x86_64" for you.  It appears to install both 'mysql' and 'mysqli'.
0
 
Jason YuAuthor Commented:
I got the following error when I tried to install "php-mysql" module.

[root@point conf]# yum install php-mysql
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.3.3-40.el6_6 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-40.el6_6 for package: php-mysql-5.3.3-40.el6_6.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: php-mysql-5.3.3-40.el6_6.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: php-mysql-5.3.3-40.el6_6.x86_64
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.73-3.el6_5 will be installed
---> Package php-common.x86_64 0:5.3.3-38.el6 will be updated
--> Processing Dependency: php-common(x86-64) = 5.3.3-38.el6 for package: php-5.3.3-38.el6.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-38.el6 for package: php-cli-5.3.3-38.el6.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-38.el6 for package: php-gd-5.3.3-38.el6.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-38.el6 for package: php-pdo-5.3.3-38.el6.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-38.el6 for package: php-xml-5.3.3-38.el6.x86_64
---> Package php-common.x86_64 0:5.3.3-40.el6_6 will be an update
--> Running transaction check
---> Package php.x86_64 0:5.3.3-38.el6 will be updated
---> Package php.x86_64 0:5.3.3-40.el6_6 will be an update
---> Package php-cli.x86_64 0:5.3.3-38.el6 will be updated
---> Package php-cli.x86_64 0:5.3.3-40.el6_6 will be an update
---> Package php-gd.x86_64 0:5.3.3-38.el6 will be updated
---> Package php-gd.x86_64 0:5.3.3-40.el6_6 will be an update
---> Package php-pdo.x86_64 0:5.3.3-38.el6 will be updated
---> Package php-pdo.x86_64 0:5.3.3-40.el6_6 will be an update
---> Package php-xml.x86_64 0:5.3.3-38.el6 will be updated
---> Package php-xml.x86_64 0:5.3.3-40.el6_6 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
 Package                        Arch                       Version                            Repository                      Size
===================================================================================================================================
Installing:
 php-mysql                      x86_64                     5.3.3-40.el6_6                     ol6_latest                      84 k
Installing for dependencies:
 mysql-libs                     x86_64                     5.1.73-3.el6_5                     ol6_latest                     1.2 M
Updating for dependencies:
 php                            x86_64                     5.3.3-40.el6_6                     ol6_latest                     1.1 M
 php-cli                        x86_64                     5.3.3-40.el6_6                     ol6_latest                     2.2 M
 php-common                     x86_64                     5.3.3-40.el6_6                     ol6_latest                     527 k
 php-gd                         x86_64                     5.3.3-40.el6_6                     ol6_latest                     109 k
 php-pdo                        x86_64                     5.3.3-40.el6_6                     ol6_latest                      77 k
 php-xml                        x86_64                     5.3.3-40.el6_6                     ol6_latest                     105 k

Transaction Summary
===================================================================================================================================
Install       2 Package(s)
Upgrade       6 Package(s)

Total download size: 5.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/8): mysql-libs-5.1.73-3.el6_5.x86_64.rpm                                                                 | 1.2 MB     00:04
(2/8): php-5.3.3-40.el6_6.x86_64.rpm                                                                        | 1.1 MB     00:03
(3/8): php-cli-5.3.3-40.el6_6.x86_64.rpm                                                                    | 2.2 MB     00:04
(4/8): php-common-5.3.3-40.el6_6.x86_64.rpm                                                                 | 527 kB     00:01
(5/8): php-gd-5.3.3-40.el6_6.x86_64.rpm                                                                     | 109 kB     00:00
(6/8): php-mysql-5.3.3-40.el6_6.x86_64.rpm                                                                  |  84 kB     00:00
(7/8): php-pdo-5.3.3-40.el6_6.x86_64.rpm                                                                    |  77 kB     00:00
(8/8): php-xml-5.3.3-40.el6_6.x86_64.rpm                                                                    | 105 kB     00:00
-----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                              325 kB/s | 5.4 MB     00:17
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
 Userid: "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
 From  : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test


Transaction Check Error:
  file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/armscii8.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MyS                                                  QL-server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/ascii.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL                                                  -server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/cp1256.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL                                                  -server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/cp1257.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL                                                  -server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/cp850.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/cp852.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/cp866.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/dec8.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-s                                                  erver-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/geostd8.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQ                                                  L-server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/greek.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/hebrew.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL                                                  -server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/hp8.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-se                                                  rver-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQ                                                  L-server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/koi8r.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/koi8u.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/latin1.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL                                                  -server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/latin2.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL                                                  -server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/latin5.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL                                                  -server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/latin7.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL                                                  -server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/macce.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/macroman.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MyS                                                  QL-server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/charsets/swe7.xml from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-s                                                  erver-5.6.24-1.el6.x86_64
  file /usr/share/mysql/czech/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-se                                                  rver-5.6.24-1.el6.x86_64
  file /usr/share/mysql/danish/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-s                                                  erver-5.6.24-1.el6.x86_64
  file /usr/share/mysql/dutch/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-se                                                  rver-5.6.24-1.el6.x86_64
  file /usr/share/mysql/english/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/estonian/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL                                                  -server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/french/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-s                                                  erver-5.6.24-1.el6.x86_64
  file /usr/share/mysql/german/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-s                                                  erver-5.6.24-1.el6.x86_64
  file /usr/share/mysql/greek/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-se                                                  rver-5.6.24-1.el6.x86_64
  file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQ                                                  L-server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/italian/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/japanese/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL                                                  -server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/korean/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-s                                                  erver-5.6.24-1.el6.x86_64
  file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package M                                                  ySQL-server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQ                                                  L-server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/polish/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-s                                                  erver-5.6.24-1.el6.x86_64
  file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MyS                                                  QL-server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/romanian/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL                                                  -server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/russian/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/serbian/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/slovak/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-s                                                  erver-5.6.24-1.el6.x86_64
  file /usr/share/mysql/spanish/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/swedish/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQL-                                                  server-5.6.24-1.el6.x86_64
  file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package MySQ                                                  L-server-5.6.24-1.el6.x86_64

Error Summary
-------------

[root@point conf]#

Open in new window

0
 
Jason YuAuthor Commented:
It looks like MySQL 5.6.24 was installed. Do I need uninstall them? and how?

thanks.

[root@point conf]# rpm -qa | grep MySQL
MySQL-devel-5.6.24-1.el6.x86_64
MySQL-client-5.6.24-1.el6.x86_64
MySQL-server-5.6.24-1.el6.x86_64
MySQL-python-1.2.3-0.3.c1.1.el6.x86_64
[root@point conf]#

Open in new window

0
 
Dave BaldwinFixer of ProblemsCommented:
I don't know at this point.  I just installed the stock packages on my CentOS 6.6 system and didn't have any problems.  If you don't have anything else on that system yet, you may want to start over.
0
 
Jason YuAuthor Commented:
I have several packages in MySQL unzip file, which one do I need install:


[root@point tmp]# ls -alth
total 427M
drwxrwxrwt.  3 root root  4.0K Apr 24 13:55 .
-rw-r--r--.  1 root root   90K Apr 24 13:41 htop-1.0.3-5.fc23.aarch64.rpm
-rw-------.  1 root root  4.1K Apr 23 10:57 yum_save_tx-2015-04-23-10-57V_NhR_.yumtx
-rw-------.  1 root root  3.5K Apr 23 10:21 yum_save_tx-2015-04-23-10-21WUXO38.yumtx
-rw-r--r--.  1 root root   68K Apr 22 09:18 php.ini.bkup
-rw-r--r--.  1 root root  214M Apr 21 16:01 MySQL-5.6.24-1.el6.x86_64.rpm-bundle.tar
dr-xr-xr-x. 25 root root  4.0K Apr 21 15:20 ..
drwxrwxrwt.  2 root root  4.0K Apr  6 11:36 .ICE-unix
-rw-r--r--.  1 7155 wheel  49M Mar 26 03:59 MySQL-test-5.6.24-1.el6.x86_64.rpm
-rw-r--r--.  1 7155 wheel 3.8M Mar 26 03:59 MySQL-shared-compat-5.6.24-1.el6.x86_64.rpm
-rw-r--r--.  1 7155 wheel 1.9M Mar 26 03:59 MySQL-shared-5.6.24-1.el6.x86_64.rpm
-rw-r--r--.  1 7155 wheel  54M Mar 26 03:58 MySQL-server-5.6.24-1.el6.x86_64.rpm
-rw-r--r--.  1 7155 wheel  85M Mar 26 03:57 MySQL-embedded-5.6.24-1.el6.x86_64.rpm
-rw-r--r--.  1 7155 wheel 3.3M Mar 26 03:57 MySQL-devel-5.6.24-1.el6.x86_64.rpm
-rw-r--r--.  1 7155 wheel  18M Mar 26 03:57 MySQL-client-5.6.24-1.el6.x86_64.rpm
[root@point tmp]# rpm -ivh MySQL-server-5.6.24-1.el6.x86_64.rpm
0
 
Jason YuAuthor Commented:
I reinstalled MySQL-Server to 5.6.24 version. However, when I tried to start up httpd server, I got the following few error lines in error log.


[Fri Apr 24 14:05:11 2015] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Fri Apr 24 14:05:11 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Apr 24 14:05:11 2015] [notice] Digest: generating secret for digest authentication ...
[Fri Apr 24 14:05:11 2015] [notice] Digest: done
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/php_mysql.dll' - /usr/lib64/php/modules/php_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[Fri Apr 24 14:05:11 2015] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips mod_wsgi/3.2 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
~

Open in new window

0
 
Jason YuAuthor Commented:
Do I need use yum to install "php-mysql" module?

Please advise, thank you.
0
 
Jason YuAuthor Commented:
in my /etc/php.ini file, I found the section for MySQL is not setup .



[MySQL]
; Allow or prevent persistent links.
; http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.allow-persistent
mysql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
; http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.max-persistent
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
; http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.max-links
mysql.max_links = -1

; Default port number for mysql_connect().  If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
; at MYSQL_PORT.
; http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.default-port
mysql.default_port =

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
; http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.default-socket
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
; http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.default-host
mysql.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
; http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.default-user
mysql.default_user =

; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
; and reveal this password!  And of course, any users with read access to this
; file will be able to reveal the password as well.
; http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.default-password
mysql.default_password =
; Maximum time (in seconds) for connect timeout. -1 means no limit
; http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.connect-timeout
mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Errors will be displayed.
; http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.trace-mode
mysql.trace_mode = Off

[MySQLi]

; Maximum number of links.  -1 means no limit.
; http://www.php.net/manual/en/mysqli.configuration.php#ini.mysqli.max-links
mysqli.max_links = -1

; Default port number for mysqli_connect().  If unset, mysqli_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
; at MYSQL_PORT.
; http://www.php.net/manual/en/mysqli.configuration.php#ini.mysqli.default-port
mysqli.default_port = 3306

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
; http://www.php.net/manual/en/mysqli.configuration.php#ini.mysqli.default-socket
mysqli.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
; http://www.php.net/manual/en/mysqli.configuration.php#ini.mysqli.default-host
mysqli.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
; http://www.php.net/manual/en/mysqli.configuration.php#ini.mysqli.default-user
mysqli.default_user =

; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw")
; and reveal this password!  And of course, any users with read access to this
; file will be able to reveal the password as well.
; http://www.php.net/manual/en/mysqli.configuration.php#ini.mysqli.default-pw
mysqli.default_pw =

; Allow or prevent reconnect
mysqli.reconnect = Off

Open in new window

0
 
Jason YuAuthor Commented:
In my /etc/php.ini file, I see a line to define extesion directory location, do I need change it?

; Directory in which the loadable extensions (modules) reside.
; http://www.php.net/manual/en/ini.core.php#ini.extension-dir
; extension_dir = "./"
0
 
Dave BaldwinFixer of ProblemsCommented:
Do Not change the extension directory.  I don't know why you have it but "php_mysql.dll" is for Windows, not Linux.  You do Not need to do anything with the MySQL or the MySQLi sections in 'php.ini'.

At this point, I am going to recommend again that you completely re-install RedHat on that machine and just use the stock packages to get it running.  You have too many things that are not going to work together at this point.
0
 
Jason YuAuthor Commented:
I am sure the mysql is running because I can start and stop it.

[root@point sbin]# mysql --socket /var/lib/mysql/mysql.sock
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@point sbin]# ps -ef | grep mysql
root     31134     1  0 14:00 pts/1    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/point.lacare.org.pid
mysql    31235 31134  0 14:00 pts/1    00:00:03 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/point.lacare.org.err --pid-file=/var/lib/mysql/point.lacare.org.pid
root     31659 19419  0 15:04 pts/1    00:00:00 grep mysql
[root@point sbin]#
0
 
Jason YuAuthor Commented:
[root@point sbin]# service mysql status
 SUCCESS! MySQL running (31235)
[root@point sbin]#
0
 
Jason YuAuthor Commented:
i resolved the database connection problem just now.

Another problem came out:

I couldn't use the root account to connect to the server remotely. any advise?

D:\mysql-5.6.24-winx64\bin>mysql.exe -u root -h point.lacare.org -p
Enter password: ********
ERROR 1130 (HY000): Host '10.100.2.107' is not allowed to connect to this MySQL
server

D:\mysql-5.6.24-winx64\bin>
0
 
Dave BaldwinFixer of ProblemsCommented:
You should not use 'root' for a remote connection.  It is a severe security problem because 'root' can do anything including deleting all databases.  Create a more restricted user with 'anyhost' privileges that can be used to connect remotely.  https://dev.mysql.com/doc/refman/5.6/en/user-account-management.html
0
 
Jason YuAuthor Commented:
Hi, Dave:

Thanks for all the help, I checked the error log file under /var/log/httpd, it still shows the following errors, may I ask what bbemod is? Is it a module with PHP orMysql?

thanks.

[Mon Apr 27 09:49:26 2015] [error] [client 10.100.2.44] File does not exist: /var/www/bbemod/bbemod
[Mon Apr 27 09:49:26 2015] [error] [client 10.100.2.44] File does not exist: /var/www/bbemod/favicon.ico
[Mon Apr 27 09:49:26 2015] [error] [client 10.100.2.44] File does not exist: /var/www/bbemod/favicon.ico
[Mon Apr 27 09:49:52 2015] [error] [client 10.100.2.44] File does not exist: /var/www/bbemod/bbemod
[Mon Apr 27 09:50:04 2015] [error] [client 10.100.2.44] File does not exist: /var/www/bbemod/bbe
[Mon Apr 27 09:53:01 2015] [error] [client 198.51.140.156] PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50, referer: http://point.lacare.org/signup.php
[Mon Apr 27 09:53:16 2015] [error] [client 198.51.140.156] File does not exist: /var/www/bbemod/bbeadmin
[Mon Apr 27 09:53:21 2015] [error] [client 198.51.140.156] PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50
[Mon Apr 27 09:53:35 2015] [error] [client 198.51.140.156] PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/bbemod/includes/class.database.php on line 50
[Mon Apr 27 09:56:27 2015] [error] [client 198.51.140.156] PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /var/www/bbemod/phpinfo.php on line 2

Open in new window

~
0
 
Dave BaldwinFixer of ProblemsCommented:
In your messages, 'bbemod' is a file and directory name.  It is not a PHP or MySQL function.
0
 
Jason YuAuthor Commented:
I got the line with error in the file:

48         public function connect()
     49         {
     50            // $this->dbconn = mysql_connect($this->host, $this->username, $this->password) or $this->notify();
     51               $this->dbconn = mysql_connect($this->host, $this->username, $this->password) or $this->notify();
     52             if($this->dbconn === false) return false;
     53


How could I update line 51, do I need put my username and password to this line?

thanks.
0
 
Dave BaldwinFixer of ProblemsCommented:
Yes, and the host.
0
 
Jason YuAuthor Commented:
Finally, I got it resolved.

Thank you all for the help.
0
 
Jason YuAuthor Commented:
Thank you Dave for all the help.
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.