访问一个调数据库页面时,apache error_log 提示
Character set '#24' is not a compiled character set and is not specified in the 'NONEXISTENT/charsets/Index' file
File 'NONEXISTENT/charsets/?.conf' not found (Errcode: 2)
Character set '#24' is not a compiled character set and is not specified in the 'NONEXISTENT/charsets/Index' file
File 'NONEXISTENT/charsets/?.conf' not found (Errcode: 2)
Character set '#24' is not a compiled character set and is not specified in the 'NONEXISTENT/charsets/Index' file
File 'NONEXISTENT/charsets/?.conf' not found (Errcode: 2)
通过phpinfo()函数看到
| MySQL Support |
enabled |
| Active Persistent Links |
0 |
| Active Links |
0 |
| Client API version |
3.23.49 |
| MYSQL_MODULE_TYPE |
builtin |
| MYSQL_SOCKET |
/tmp/mysql.sock |
| MYSQL_INCLUDE |
no value |
| MYSQL_LIBS |
no value |
上面这个client版本,与系统上正在使用的 mysql-4.0.24 版本不一致,当初编译php时没指定mysql路径
解决方法
重新编译php加入 --with-mysql=/usr/local/mysql
新的问题
编译时出现错误
mysql/php_mysql.c:1160: undefined reference to `mysql_create_db'
......
collect2: ld returned 1 exit status
解决方法
# clean make
# CFLAGS="-DUSE_OLD_FUNCTIONS -O6 -march=pentiumpro -fomit-frame-pointer" ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs=/usr/local/apache/bin/apxs
# make && make install
重启apache
| MySQL Support |
enabled |
| Active Persistent Links |
0 |
| Active Links |
0 |
| Client API version |
4.0.24 |
| MYSQL_MODULE_TYPE |
external |
| MYSQL_SOCKET |
/tmp/mysql.sock |
| MYSQL_INCLUDE |
-I/usr/local/mysql/include/mysql |
| MYSQL_LIBS |
-L/usr/local/mysql/lib/mysql -lmysqlclient |
ok!