mySQL Installation Problem with PHP 5

mySQL Installation Problem with PHP 5

by Scott Wilhelm -
Number of replies: 6
I recently installed RHEL 4, mySQL 5.0.2 & PHP 5 on my system....I've put in all the libraries & headers for mySQL, I've gone through the directions at http://us3.php.net/mysql to install mySQL with PHP, but nothing's working.

While going through the setup screens, I keep getting this error: 

PHP has not been properly configured with the MySQL extension so that
it can communicate with MySQL. Please check your php.ini file or
recompile PHP.

Does anyone have any ideas/suggestions/comments/ways to end this misery?

Thanks!

Scott
Average of ratings: -
In reply to Scott Wilhelm

Re: mySQL Installation Problem with PHP 5

by Ken Wilson -
Scott

From what I can recall, the first thing to check is that SElinux is disabled for the mysql daemon. Use this command: system-config-securitylevel.

Also, do a basic check to see if the mysql extension is uncommented in the php.ini file.

Let us know how it goes.

Ken
In reply to Ken Wilson

Re: mySQL Installation Problem with PHP 5

by Scott Wilhelm -
I disabled selinux for mysqld (btw, i can't get the mysql service to start on its own...when the system boots up, i have to type in mysqld -u root to get the mysql service to start....and it doesn't even show up as a service...)

Here's my php.ini for the mysql section below.

Any suggestions?

Thanks,

Scott



[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
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.
mysql.default_port =

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
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.
mysql.default_password =

; Maximum time (in seconds) for connect timeout. -1 means no limit
mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Errors will be displayed.
mysql.trace_mode = Off

[mSQL]
; Allow or prevent persistent links.
msql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
msql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
msql.max_links = -1

In reply to Scott Wilhelm

Re: mySQL Installation Problem with PHP 5

by Ken Wilson -
Scott

Can you confirm that in the extension section of php.ini the extension line for mysql has the semicolon removed, e.g. extension=mysql.so

Also, check that you have all the php packages installed, either using www.rpmfind.net or if up2date is installed use this line

up2date --install php*

Remember to restart apache after any changes to php.ini.

Ken
In reply to Ken Wilson

Re: mySQL Installation Problem with PHP 5

by Makalo Motsamai -

Thanks Ken,

You were brief and right to the point. Ur solution solved my problem.

Rgrds,

Makalo

In reply to Scott Wilhelm

Re: mySQL Installation Problem with PHP 5

by Benoit Brosseau -
first install yum

then do a yum install php-mysql

then do you list php*

and install whats you want for php

then do a /sbin/service httpd restart

should do it or at least its the easiest way i can think of
In reply to Benoit Brosseau

Re: mySQL Installation Problem with PHP 5

by Scott Wilhelm -
i just installed yum, but i can't figure out how to add a repository.

any chance you can give me some insight on that part?

scott

ps.  i apologize for my linux ignorance...i'm still windows-ized...