QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 55577|回复: 28

php的配置表项没有mysql,是否重新编译安装

[复制链接]
发表于 2005-9-17 23:16:12 | 显示全部楼层 |阅读模式
php5.0.5+apache2.0.54+mysql5.0.12

以上都已安装完毕,查看PHP的info.php发现没有包含mysql的
配置,我不太清楚有什么不妥, 反正站已经建好,外网能够访问,
但是别人的配置文档里都有mysql的信息,请问是否要重新
将PHP编译安装,以及如何做

我的info.php内容:

PHP Version 5.0.5

System Linux KUN 2.6.12.3 #1 Wed Jul 20 03:16:26 EDT 2005 i686
Build Date Sep 9 2005 18:59:50
Configure Command './configure' '--with-apxs2=/usr/local/apache2/bin/apxs'
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/lib/php.ini
PHP API 20031224
PHP Extension 20041030
Zend Extension 220040412
Debug Build no
Thread Safety disabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, http, ftp
Registered Stream Socket Transports tcp, udp, unix, udg

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.0.5, Copyright (c) 1998-2004 Zend Technologies


PHP Credits
Configuration
PHP Core
Directive Local Value Master Value
allow_call_time_pass_reference On On
allow_url_fopen On On
always_populate_raw_post_data Off Off
arg_separator.input & &
arg_separator.output & &
asp_tags Off Off
auto_append_file no value no value
auto_globals_jit On On
auto_prepend_file no value no value
browscap no value no value
default_charset no value no value
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_classes no value no value
disable_functions no value no value
display_errors On On
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root no value no value
enable_dl On On
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting 2039 2039
expose_php On On
extension_dir ./ ./
file_uploads On On
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .:/usr/local/lib/php .:/usr/local/lib/php
log_errors Off Off
log_errors_max_len 1024 1024
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
mail.force_extra_parameters no value no value
max_execution_time 30 30
max_input_time 60 60
open_basedir no value no value
output_buffering no value no value
output_handler no value no value
post_max_size 8M 8M
precision 12 12
register_argc_argv On On
register_globals Off Off
register_long_arrays On On
report_memleaks On On
report_zend_debug On On
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
safe_mode_include_dir no value no value
sendmail_from no value no value
sendmail_path -t -i -t -i
serialize_precision 100 100
short_open_tag On On
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
track_errors Off Off
unserialize_callback_func no value no value
upload_max_filesize 2M 2M
upload_tmp_dir no value no value
user_dir no value no value
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance On On
zend.ze1_compatibility_mode Off Off

apache2handler
Apache Version Apache/2.0.54 (Unix) PHP/5.0.5
Apache API Version 20020903
Server Administrator [email protected]
Hostnameort amonkun.6600.org:80
User/Group nobody(99)/-1
Max Requests Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts Connection: 300 - Keep-Alive: 15
Virtual Server No
Server Root /usr/local/apache2
Loaded Modules core mod_access mod_auth mod_include mod_log_config mod_env mod_setenvif prefork http_core mod_mime mod_status mod_autoindex mod_asis mod_cgi mod_negotiation mod_dir mod_imap mod_actions mod_userdir mod_alias mod_so mod_php5

Directive Local Value Master Value
engine 1 1
last_modified 0 0
xbithack 0 0

Apache Environment
Variable Value
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en) Opera 8.02
HTTP_HOST localhost
HTTP_ACCEPT text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
HTTP_ACCEPT_LANGUAGE en,zh-cn;q=0.9
HTTP_ACCEPT_CHARSET iso-8859-1, utf-8, utf-16, *;q=0.1
HTTP_ACCEPT_ENCODING deflate, gzip, x-gzip, identity, *;q=0
HTTP_COOKIE ipfrom=%B1%BE%B5%D8%CD%F8%C2%E7%0D; lastip=127.0.0.1; ifregip=127.0.0.1; ol_offset=97; PHPSESSID=7ee741d3e0887531264a4314a3c90a9b; lastfid=2; lastvisit=1126926772
HTTP_COOKIE2 $Version=1
HTTP_CONNECTION Keep-Alive, TE
HTTP_TE deflate, gzip, chunked, identity, trailers
PATH /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
SERVER_SIGNATURE <address>Apache/2.0.54 (Unix) PHP/5.0.5 Server at localhost Port 80</address>
SERVER_SOFTWARE Apache/2.0.54 (Unix) PHP/5.0.5
SERVER_NAME localhost
SERVER_ADDR 127.0.0.1
SERVER_PORT 80
REMOTE_ADDR 127.0.0.1
DOCUMENT_ROOT /home/www
SERVER_ADMIN [email protected]
SCRIPT_FILENAME /home/www/info.php
REMOTE_PORT 4880
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING no value
REQUEST_URI /info.php
SCRIPT_NAME /info.php

HTTP Headers Information
HTTP Request Headers
HTTP Request GET /info.php HTTP/1.1
User-Agent Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en) Opera 8.02
Host localhost
Accept text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Accept-Language en,zh-cn;q=0.9
Accept-Charset iso-8859-1, utf-8, utf-16, *;q=0.1
Accept-Encoding deflate, gzip, x-gzip, identity, *;q=0
Cookie ipfrom=%B1%BE%B5%D8%CD%F8%C2%E7%0D; lastip=127.0.0.1; ifregip=127.0.0.1; ol_offset=97; PHPSESSID=7ee741d3e0887531264a4314a3c90a9b; lastfid=2; lastvisit=1126926772
Cookie2 $Version=1
Connection Keep-Alive, TE
TE deflate, gzip, chunked, identity, trailers
HTTP Response Headers
X-Powered-By PHP/5.0.5
Keep-Alive timeout=15, max=100
Connection Keep-Alive
Transfer-Encoding chunked
Content-Type text/html

ctype
ctype functions enabled

dom
DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.6.19
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled

iconv
iconv support enabled
iconv implementation glibc
iconv library version 2.3.4

Directive Local Value Master Value
iconv.input_encoding ISO-8859-1 ISO-8859-1
iconv.internal_encoding ISO-8859-1 ISO-8859-1
iconv.output_encoding ISO-8859-1 ISO-8859-1

libxml
libXML support active
libXML Version 2.6.19
libXML streams enabled

pcre
PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 6.2 01-Aug-2005

posix
Revision $Revision: 1.60.2.4 $

session
Session Support enabled
Registered save handlers files user sqlite
Registered serializer handlers php php_binary

Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 4 4
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path no value no value
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 0 0

SimpleXML
Simplexml support enabled
Revision $Revision: 1.139.2.4 $
Schema support enabled

SPL
SPL support enabled
Interfaces RecursiveIterator, SeekableIterator
Classes ArrayIterator, ArrayObject, CachingIterator, CachingRecursiveIterator, DirectoryIterator, FilterIterator, LimitIterator, ParentIterator, RecursiveDirectoryIterator, RecursiveIteratorIterator, SimpleXMLIterator

SQLite
SQLite support enabled
PECL Module version 2.0-dev $Id: sqlite.c,v 1.146.2.7 2005/06/07 15:38:37 dmitry Exp $
SQLite Library 2.8.14
SQLite Encoding iso8859

Directive Local Value Master Value
sqlite.assoc_case 0 0

standard
Regex Library Bundled library enabled
Dynamic Library Support enabled

Directive Local Value Master Value
assert.active 1 1
assert.bail 0 0
assert.callback no value no value
assert.quiet_eval 0 0
assert.warning 1 1
auto_detect_line_endings 0 0
date.default_latitude 31.7667 31.7667
date.default_longitude 35.2333 35.2333
date.sunrise_zenith 90.83 90.83
date.sunset_zenith 90.83 90.83
default_socket_timeout 60 60
safe_mode_allowed_env_vars PHP_ PHP_
safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATH
url_rewriter.tags a=href,area=href,frame=src,input=src,form=,fieldset= a=href,area=href,frame=src,input=src,form=,fieldset=
user_agent no value no value

tokenizer
Tokenizer Support enabled

xml
XML Support active
XML Namespace Support active
libxml2 Version 2.6.19

Additional Modules
Module Name

Environment
Variable Value
CONSOLE /dev/console
TERM linux
progress 34
LD_LIBRARY_PATH /usr/local/apache2/lib:
INIT_VERSION sysvinit-2.85
PATH /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
LC_MESSAGES en_US
vga 791
runlevel 5
RUNLEVEL 5
PWD /
LANG zh_CN.GB18030
previous N
PREVLEVEL N
kscripts 24
SHLVL 3
HOME /
sscripts 34
splash silent
_ /usr/local/apache2/bin/httpd

PHP Variables
Variable Value
_REQUEST["ipfrom"] 本地网络
_REQUEST["lastip"] 127.0.0.1
_REQUEST["ifregip"] 127.0.0.1
_REQUEST["ol_offset"] 97
_REQUEST["PHPSESSID"] 7ee741d3e0887531264a4314a3c90a9b
_REQUEST["lastfid"] 2
_REQUEST["lastvisit"] 1126926772
_COOKIE["ipfrom"] 本地网络
_COOKIE["lastip"] 127.0.0.1
_COOKIE["ifregip"] 127.0.0.1
_COOKIE["ol_offset"] 97
_COOKIE["PHPSESSID"] 7ee741d3e0887531264a4314a3c90a9b
_COOKIE["lastfid"] 2
_COOKIE["lastvisit"] 1126926772
_SERVER["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en) Opera 8.02
_SERVER["HTTP_HOST"] localhost
_SERVER["HTTP_ACCEPT"] text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
_SERVER["HTTP_ACCEPT_LANGUAGE"] en,zh-cn;q=0.9
_SERVER["HTTP_ACCEPT_CHARSET"] iso-8859-1, utf-8, utf-16, *;q=0.1
_SERVER["HTTP_ACCEPT_ENCODING"] deflate, gzip, x-gzip, identity, *;q=0
_SERVER["HTTP_COOKIE"] ipfrom=%B1%BE%B5%D8%CD%F8%C2%E7%0D; lastip=127.0.0.1; ifregip=127.0.0.1; ol_offset=97; PHPSESSID=7ee741d3e0887531264a4314a3c90a9b; lastfid=2; lastvisit=1126926772
_SERVER["HTTP_COOKIE2"] $Version=1
_SERVER["HTTP_CONNECTION"] Keep-Alive, TE
_SERVER["HTTP_TE"] deflate, gzip, chunked, identity, trailers
_SERVER["PATH"] /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
_SERVER["SERVER_SIGNATURE"] <address>Apache/2.0.54 (Unix) PHP/5.0.5 Server at localhost Port 80</address>
_SERVER["SERVER_SOFTWARE"] Apache/2.0.54 (Unix) PHP/5.0.5
_SERVER["SERVER_NAME"] localhost
_SERVER["SERVER_ADDR"] 127.0.0.1
_SERVER["SERVER_PORT"] 80
_SERVER["REMOTE_ADDR"] 127.0.0.1
_SERVER["DOCUMENT_ROOT"] /home/www
_SERVER["SERVER_ADMIN"] [email protected]
_SERVER["SCRIPT_FILENAME"] /home/www/info.php
_SERVER["REMOTE_PORT"] 4880
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"] no value
_SERVER["REQUEST_URI"] /info.php
_SERVER["SCRIPT_NAME"] /info.php
_SERVER["PHP_SELF"] /info.php
_SERVER["argv"]

Array
(
)
_SERVER["argc"] 0
_ENV["CONSOLE"] /dev/console
_ENV["TERM"] linux
_ENV["progress"] 34
_ENV["LD_LIBRARY_PATH"] /usr/local/apache2/lib:
_ENV["INIT_VERSION"] sysvinit-2.85
_ENV["PATH"] /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
_ENV["LC_MESSAGES"] en_US
_ENV["vga"] 791
_ENV["runlevel"] 5
_ENV["RUNLEVEL"] 5
_ENV["PWD"] /
_ENV["LANG"] zh_CN.GB18030
_ENV["previous"] N
_ENV["PREVLEVEL"] N
_ENV["kscripts"] 24
_ENV["SHLVL"] 3
_ENV["HOME"] /
_ENV["sscripts"] 34
_ENV["splash"] silent
_ENV["_"] /usr/local/apache2/bin/httpd

PHP License

This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact [email protected].


而且浏览器进入phpmyadmin出现:

无法载入 mysql 扩展,
请检查 PHP 配置
文档

是不是因为上面的原因
PHP没有集成mysql的模块

记得当初装的时候,我的安装顺续是:apache,mysql,php
似乎见到的所有文档都是先装mysql

请高手指点一二
发表于 2005-9-17 23:28:06 | 显示全部楼层
自己编译的?

估计需要重新编译了。
建议你看看 configure 的配置参数,很多东西都需要的~~~
回复

使用道具 举报

 楼主| 发表于 2005-9-17 23:44:17 | 显示全部楼层
重新编译php的话,原来的要不要卸载掉呢?
是不是先./make clean呢?
我是新手,知之甚少,请多指教,谢谢
回复

使用道具 举报

发表于 2005-9-17 23:47:43 | 显示全部楼层
make clean 只是清理编译目录里的编译好的二进制文件。

make uninstall 才是卸载~~~

你最好 make clean 以下(不这么其实也没事,而且如果是第二次编译,可以加快速度)
make uninstall 一般不需要
回复

使用道具 举报

 楼主| 发表于 2005-9-18 00:17:38 | 显示全部楼层
我查看了./configure  --help,配置项目贼多,眼都花了,小弟只选出了以下几项,请大侠看看还要补充什么
--with-apxs[=FILE]     
--with-apache[=DIR]
--with-mysql[=DIR]   Include MySQL support. DIR is the MySQL base directory (请问是整个MYSQL的路径:/var/lib/mysql 还是其下的一个/var/lib/mysql/www)
--with-mysqli[=FILE]   (怎么是mysqli,跟mysql有什么不同呢?)

烦劳了,谢谢啊
回复

使用道具 举报

发表于 2005-9-18 10:35:42 | 显示全部楼层
打开tarball包,察看INSTALL文件,定位到Apache 2.0 on Unix systems

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli

我的MySQL也是编译安装的,configure的时候加了prefix=/usr/local/mysql路径,如果你不知道MySQL安装到哪里去了,使用whereis mysql看看终端给你的提示

如果你下载了PHP Manual就会知道MySQLi这个对象提供了更多的接口,远远比MySQL多
回复

使用道具 举报

发表于 2005-9-18 10:38:48 | 显示全部楼层
[quote:f94cdb42d5="timonkun"]重新编译php的话,原来的要不要卸载掉呢?
是不是先./make clean呢?
我是新手,知之甚少,请多指教,谢谢[/quote]

不用卸载,不像Windows下安装软件会产生很多垃圾文件

configure之后,来个make clean就把以前编译的东东clean掉了,所谓clean嘛
回复

使用道具 举报

 楼主| 发表于 2005-9-18 11:44:26 | 显示全部楼层

configure出现问题

以下是编译的部分信息:
[root@KUN php-5.0.5]# ./configure --prefix=/usr/local/lib/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/var/lib/mysql --with-mysqli

×××

configure: error: Cannot find MySQL header files under /var/lib/mysql.
Note that the MySQL client library is not bundled anymore.
[root@KUN php-5.0.5]# make
make: *** 没有指明目标并且找不到 makefile。 停止。


怎么回事?
configure: error: Cannot find MySQL header files under /var/lib/mysql.
Note that the MySQL client library is not bundled anymore.


请指点
回复

使用道具 举报

发表于 2005-9-18 12:18:40 | 显示全部楼层
MySQL并没有安装在/var/lib/mysql下

请使用whereis mysql看看MySQL的路径

你的MySQL是编译安装的么?
回复

使用道具 举报

发表于 2005-9-18 12:31:21 | 显示全部楼层
哪个 mysql 目录指的是他的 base 目录,记得里面有 bin 、data 什么的。
还有不要忘了装 mysql-devel
回复

使用道具 举报

 楼主| 发表于 2005-9-18 20:26:03 | 显示全部楼层
MySQL并没有安装在/var/lib/mysql下

我不清楚到底是MYSQL的应用程序啊,还是它的存储数据路径

请使用whereis mysql看看MySQL的路径

这是 whereis mysql信息
[root@KUN Amon]# whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz


你的MySQL是编译安装的么?

不是,是RPM安装:
MySQL-client-5.0.12-0.i386.rpm
MySQL-server-5.0.12-0.i386.rpm

哪个 mysql 目录指的是他的 base 目录,记得里面有 bin 、data 什么的。
还有不要忘了装 mysql-devel

哦,mysql-devel在哪里看装了还是没装?我实在记不清了
回复

使用道具 举报

发表于 2005-9-18 20:58:31 | 显示全部楼层
PHP编译时需要的是MySQL的Lib路径

with-mysql=/usr/lib/mysql

如果你安装的RPM包,那么PHP为什么不一起安装RPM包,方便

如果PHP安装的Tarball,那么MySQL也安装Tarball
回复

使用道具 举报

发表于 2005-11-7 14:29:28 | 显示全部楼层
我用SUSE9.3,系统自带MYSQL4.0.X了。
whersis mysql结果:
/usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

都指定过了,配置PHP还是找不到。
回复

使用道具 举报

发表于 2005-11-7 18:00:07 | 显示全部楼层
[quote:d42d5c0d19="prouser"]我用SUSE9.3,系统自带MYSQL4.0.X了。
whersis mysql结果:
/usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

都指定过了,配置PHP还是找不到。 [/quote]
需要安装 mysql-devel
回复

使用道具 举报

发表于 2005-11-7 19:53:45 | 显示全部楼层
[quote:f94ccc2c42="jiangtao9999"][quote:f94ccc2c42="prouser"]我用SUSE9.3,系统自带MYSQL4.0.X了。
whersis mysql结果:
/usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

都指定过了,配置PHP还是找不到。 [/quote]
需要安装 mysql-devel[/quote]
已经看了你在10楼的回复,尝试了以后不行才发贴的。
我回帖从来都先看贴的,呵呵。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-17 00:07 , Processed in 0.049975 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表