LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-06-2006, 05:23 PM   #1
librano
Member
 
Registered: Jul 2004
Location: Here, there and everywhere.
Distribution: Arch+KDE, Linux Mint Fluxbox CE
Posts: 163

Rep: Reputation: 31
Configuring PHP for MySQL5 in Mandriva 2006 Free


Hi all!

Having some problems so I came back to the place I find solutions!

I am using Mandriva 2006 Free. I have to build a server with Apache2, PHP5 and MySQL5. Apache and PHP I can get from the default Mandriva repositories, no problem. Problem comes with MySQL5. Mandriva only has MySQL4 so I am using MySQL 5 from the Mandriva Cooker Repositories... where I get version 5.0.19 Installation went ok from what I saw... I can log into MySQL no problems and it shows me the correct version nr and all.

However, when I create a PHP test page with the following code
Code:
<?php phpinfo(); ?>
the output doesnt have a section with MySQL! even though it shows that it has parsed the mysql.ini and mysqli.ini file...

Additional .ini files parsed
Code:
/etc/php.d/11_calendar.ini, /etc/php.d/12_ctype.ini,
/etc/php.d/22_ftp.ini, /etc/php.d/23_gd.ini, 
/etc/php.d/24_gettext.ini, /etc/php.d/29_mbstring.ini,
 /etc/php.d/32_fileinfo.ini, /etc/php.d/36_mysql.ini, 
/etc/php.d/37_mysqli.ini, /etc/php.d/41_pcre.ini, /etc/php.d/43_posix.ini, 
/etc/php.d/47_session.ini, /etc/php.d/57_sysvsem.ini, 
/etc/php.d/58_sysvshm.ini, /etc/php.d/60_tokenizer.ini, /etc/php.d/62_xml.ini,
 /etc/php.d/62_xmlrpc.ini, /etc/php.d/65_yp.ini, /etc/php.d/66_bcmath.ini, 
/etc/php.d/99_eaccelerator.ini, /etc/php.d/A14_date.ini, 
/etc/php.d/A30_ffmpeg.ini
and... extension_dir is
Code:
  /usr/lib/php/extensions/
which contains the mysql.so and mysqli.so files

here are the relevant parts of my my php.ini file
Code:
[PHP]

doc_root =

user_dir =

; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/lib/php/extensions/"
;extension_dir = "./"

; For example, on Windows:
;
;   extension=msql.dll
;
; ... or under UNIX:
;
;   extension=msql.so
;
extension=mysql.so
extension=mysqli.so

; Note that it should be the name of the module only; no directory information
; needs to go here.  Specify the location of the extension with the
; extension_dir directive above.
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

define_syslog_variables().
define_syslog_variables  = Off

[SQL]
sql.safe_mode = Off

[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 secondes) 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

[MySQLI]

; Maximum number of links.  -1 means no limit.
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.
mysqli.default_port = 3306

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

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

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

; Allow or prevent reconnect
mysqli.reconnect = Off
If you need anything else please ask me ans i shall provide.

why am i getting this error?

thanks.
 
Old 04-06-2006, 05:53 PM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Maybe it would be better to get all the AMP packages from cooker. I usually just compile from source so that I have more control over the installation.
 
Old 04-06-2006, 07:29 PM   #3
librano
Member
 
Registered: Jul 2004
Location: Here, there and everywhere.
Distribution: Arch+KDE, Linux Mint Fluxbox CE
Posts: 163

Original Poster
Rep: Reputation: 31
Thanks for the reply reddazz...

But advice I got from another source suggested I use the cooker repositories instead of compiling from source because they are easier, more compatible with Mandriva, and 'better than what I can compile myself'.I would also like to use Mandriva repositories as upgrading will be easier in the longrun.

However, does MySQL not showing in the PHP test page mean that MySQL cannot be accessed from PHP in a real world situation?

Really can't see where the problem is. I guess I'll just go ahead and see if this will work with a website... Working against a schedule here... can't wait any longer

More suggestions are most welcome.

Not so keen on installing cooker AMP rpms for stability reasons... but i'll give that a try as well

Last edited by librano; 04-06-2006 at 07:51 PM.
 
Old 04-06-2006, 08:06 PM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Quote:
But advice I got from another source suggested I use the cooker repositories instead of compiling from source because they are easier, more compatible with Mandriva, and 'better than what I can compile myself.
Thats not accurate at all. Compiling from source gives you greater control over the options you use in your installation. If you get the Mandriva rpms, there are many things that are included that you most likely won't even need and can be potential security holes. If you think about it, how can compiling from source be less compatible with Mandriva since rpms are built from the same source.

Hope you have better luck with the Cooker rpms and that everything works fine.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sound Within Mandriva 2006 Free UlberMelder Linux - General 3 10-18-2006 06:04 PM
No source code in Mandriva 2006 Free? qscomputing Mandriva 4 03-15-2006 07:31 AM
hdtv on mandriva free 2006? davidleroux1 Mandriva 19 01-08-2006 02:58 AM
mandriva 2006 free version and smartlink vinzer Mandriva 0 12-10-2005 04:08 AM
Mandriva Free 2006 on a widescreen LCD Conway Mandriva 12 12-07-2005 04:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration