Re: MySQL unavailable after compile and Install
| From: | php at karsites dot net | Date: | Wed, 01 Mar 2006 23:26:05 +0000 |
| Subject: | Re: MySQL unavailable after compile and Install | ||
| References: | 1 | Groups: | php.install |
| Request: | Send a blank email to php-install+get-17124@lists.php.net to get a copy of this message | ||
Hi Boyd.
It sounds like that php5 cannot find the mysql.so and
mysqli.so shared dynamically loaded modules.
There could be a few reasons for this.
First thing to do is to check the:
Configuration File (php.ini) Path /usr/local/php-5.1.2/lib/php.ini
which is the 6th entry down for my phpinfo() output.
You need the php.ini config file to be in the above
directory path, for php 5 to find it.
Next in php.ini, you need to tell php where the loadable
modules, mysql.so and mysqli can be found. Use this
directive:
(for my php.ini it's)
; Directory in which the loadable extensions (modules) reside.
extension_dir = /usr/local/php-5.1.2/lib/php/extensions/no-debug-non-zts-20050922
then tell php to load the modules with:
[extension section]
extension=mysql.so
extension=mysqli.so
;extension=sysvshm.so
;extension=exif.so
You don't need to use the default extension_dir.
You can put the modules into any directory that php5 can
read, as long as the extension_dir is pointing there, so
php 5 can find the modules.
Don't forget to set the values of the [mysql] and [mysqli]
sections in php.ini with something like:
;-------------------------------------------------------------------------
[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 lo ok
; at MYSQL_PORT.
;mysql.default_port =
; Default socket name for local MySQL connects. If empty,
; uses the built-in MySQL defaults.
mysql.default_socket = /var/lib/mysql/mysql.sock
and
[MySQLi]
; 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.
;mysqli.default_port =
; Default socket name for local MySQL connects. If empty,
; uses the built-in MySQL defaults.
mysqli.default_socket = /var/lib/mysql/mysql.sock
;-------------------------------------------------------------------------
Hopefully, that should do it!
Regards
Keith
In theory, theory and practice are the same;
In practice they are not.
On Wed, 1 Mar 2006, Boyd Hemphill wrote:
> To: php-install@lists.php.net
> From: Boyd Hemphill <Boyd.Hemphill@esc13.txed.net>
> Subject: [PHP-INSTALL] MySQL unavailable after compile and Install
>
> Hello:
>
> On RHEL4 I build PHP 5.1.2 with the following configure command:
>
> ./configure --cache-file=../config.cache --prefix=/usr
> --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
> --libexecdir=/usr/libexec --datadir=/usr/share
> --sysconfdir=/etc --sharedstatedir=/usr/com
> --localstatedir=/var --libdir=/usr/lib
> --includedir=/usr/include --infodir=/usr/share/info
> --mandir=/usr/share/man --build=i386-redhat-linux
> --host=i386-redhat-linux --target=i386-redhat-linux-gnu
> --with-libdir=lib --with-apxs2 --disable-debug
> --with-layout=GNU --with-config-file-path=/etc
> --with-config-file-scan-dir=/etc/php.d
> --with-exec-dir=/usr/bin --enable-magic-quotes
> --disable-rpath --with-libxml-dir=/usr --with-openssl
> --with-pcre-regex=/usr --with-zlib --enable-bcmath=shared
> --enable-calendar --with-curl --enable-dom=shared
> --enable-exif --enable-ftp --with-gd=shared
> --with-jpeg-dir=/usr --with-png --with-png-dir=/usr
> --with-freetype-dir=/usr --enable-gd-native-ttf
> --with-gettext --with-gmp --with-imap-ssl
> --with-ldap=shared --enable-mbstring=shared
> --enable-mbregex
> --with-mime-magic=/usr/share/file/magic.mime
> --with-mysql=shared,/usr
> --with-mysqli=shared,/usr/bin/mysql_config --enable-shmop
> --enable-ucd-snmp-hack --enable-sockets --without-sqlite
> --enable-sysvmsg --enable-sysvsem --enable-sysvshm
> --enable-wddx --with-xml --with-expat-dir=/usr
> --enable-xmlreader=shared --with-xmlrpc=shared
> --with-iconv --with-xsl=shared,/usr
> --with-pear=/usr/share/pear --enable-memory-limit
> --with-pic --with-dom-xslt=/usr --with-dom-exslt=/usr
> --enable-track-vars --enable-trans-sid --enable-yp
> --enable-mbstr-enc-trans
>
> Please note the --with-mysql and --with-mysqli switches.
> However, my phpinfo() output does not show either mysql
> or mysqli as avaialbe. Did I miss a step?
> I am pretty new at compiling and installing so the
> obvious may be the answer.
>
> Thanks for your time
>
> Best Regards,
> Boyd E. Hemphill
> Database Administrator
> Region XIII - Educational Service Center
> MySQL Certified Professional
> boyd.hemphill@esc13.txed.net
> (512) 919-5413