php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7678 Unable to establish connection: Can't initialize character set 7
Submitted: 2000-11-07 14:15 UTC Modified: 2000-11-07 18:53 UTC
From: maxkir at email dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0 Latest CVS (07/11/2000) OS: Solaris x86
Private report: No CVE-ID: None
 [2000-11-07 14:15 UTC] maxkir at email dot com
CGI version of PHP4. (Apache module fails too)

./configure  \
--with-jpeg-dir=/usr/local \
--with-gd --with-oracle \
--with-mysql \
--disable-debug \
--enable-magic-quotes=yes \
--enable-memory-limit=yes \
--enable-url-fopen-wrapper=no \
--enable-sysvsem=yes \
--enable-sysvshm=yes  \
--enable-track-vars=yes \
--with-system-regex \
--enable-safe-mode \
--with-gdbm \
--with-java=/usr/local/j2sdk1_3_0 \
--with-zlib

magnat!kir$ mysql --version
mysql  Ver 10.12 Distrib 3.23.25-beta, for pc-solaris2.7 (i386)

Mysql configure line:
./configure  --without-debug --with-charset=koi8_ru --prefix=/usr/local --with
out-docs --disable-shared

Locale setting:
magnat!kir$ echo $LC_ALL
ru.koi8-r

Script:

magnat!kir$ cat ~/public_html/a.php
<?
$a = mysql_connect("localhost","kir","kir");
$res = mysql("kir_db", "select count(*) from test");
echo mysql_result($res,0);
echo $a;
?>

Run and ERROR:
magnat!kir$ ~/SOFT/bin/php -f ~/public_html/a.php
File 'NONEXISTENT/charsets/?.conf' not found (Errcode: 2)
Character set '#7' is not a compiled character set and is not specified in the '
NONEXISTENT/charsets/Index' file
<br>
<b>Warning</b>:  MySQL Connection Failed: Can't initialize character set 7 (path
: default)
 in <b>/h/home/kir/public_html/a.php</b> on line <b>2</b><br>
File 'NONEXISTENT/charsets/?.conf' not found (Errcode: 2)
Character set '#7' is not a compiled character set and is not specified in the '
NONEXISTENT/charsets/Index' file
<br>
<b>Warning</b>:  MySQL Connection Failed: Can't initialize character set 7 (path
: default)
 in <b>/h/home/kir/public_html/a.php</b> on line <b>3</b><br>
<br>
<b>Warning</b>:  MySQL:  A link to the server could not be established in <b>/h/
home/kir/public_html/a.php</b> on line <b>3</b><br>
<br>
<b>Warning</b>:  Supplied argument is not a valid MySQL result resource in <b>/h
/home/kir/public_html/a.php</b> on line <b>4</b><br>




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-07 15:24 UTC] stas@php.net
For the record: I had this problem too, it was cured with using installed MySQL library and not that supplied with PHP (i. e., --with-mysql=/path/to/mysql/dir). Please try it, it might help.
 [2000-11-07 16:14 UTC] maxkir at email dot com
I tried to use original mysql library and rebuild.
IMHO, something wrong with configure process.
I get:

make[1]: Entering directory `/h/home/kir/SRC/php4'
/bin/sh /h/home/kir/SRC/php4/libtool --silent --mode=link gcc  -I. -I/h/home/kir
/SRC/php4/ -I/h/home/kir/SRC/php4 -I/h/home/kir/SRC/php4/main -I/h/home/kir/SRC/
php4/Zend -I/h/home/kir/SRC/php4 -I/usr/local/include -I/usr/local/include/freet
ype -I/usr/local/include/mysql -I/u/oracle7/rdbms/public -I/u/oracle7/rdbms/demo
 -I/u/oracle7/network/public -I/h/home/kir/SRC/php4/ext/xml/expat/xmltok -I/h/ho
me/kir/SRC/php4/ext/xml/expat/xmlparse -I/h/home/kir/SRC/php4/TSRM  -D_POSIX_PTH
READ_SEMANTICS -DXML_BYTE_ORDER=12 -g -O2   -o php -export-dynamic       stub.lo
 libphp4.la
Undefined                       first referenced
 symbol                             in file
mysql_num_fields                    .libs/libphp4.a(php_mysql.o)
mysql_num_rows                      .libs/libphp4.a(php_mysql.o)
mysql_insert_id                     .libs/libphp4.a(php_mysql.o)
mysql_field_count                   .libs/libphp4.a(php_mysql.o)
mysql_errno                         .libs/libphp4.a(php_mysql.o)
mysql_error                         .libs/libphp4.a(php_mysql.o)
mysql_affected_rows                 .libs/libphp4.a(php_mysql.o)
ld: fatal: Symbol referencing errors. No output written to php
collect2: ld returned 1 exit status
make[1]: *** [php] Error 1
 [2000-11-07 18:26 UTC] rasmus@php.net
Try a 'make clean' and recompile with your new --with-mysql=/usr/local switch.
 [2000-11-07 18:38 UTC] maxkir at email dot com
After upgrade to Mysql 3.23.25-beta and full recompile works fine. Thank you!
 [2000-11-07 18:53 UTC] rasmus@php.net
Resolved
 [2004-10-01 00:41 UTC] mike at datahost dot gr
I had the same problem and also solved it with --with-mysql=/usr/local/mysql (didnt work with plain /usr/local path instead). It works prety fine with mysql's pre-compiled binaries...

My server configuration was(for linux users):
 - apache 1.3.31 
 - php 4.3.8
 - MySQL 4.0.17-standard (pre-comp binary)

Thanks rasm ;)
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jan 19 08:03:13 2022 UTC