开启mysql支持?需要开启什么呢?能不能给讲明白点?本来就是想整和php+mysql+iis+环境。 我自己搜索了好多,就是纳闷解决不了问题,单独用mysql,我可以创表,添加等操作都可以。但安装了PHP后,虽然仍可以单独工作,但是一些与PHP联接的就是不行。用http://localhost/ 也不能打开。还有就是mysqladmin也不能用。根据网上的资料,我复制了php5ts.dll和libmysql.dll到windows32中,也改了config.inc.php配置,如下:<?php/* $Id: config.sample.inc.php 9689 2006-11-10 20:05:49Z nijel $ */ // vim: expandtab sw=4 ts=4 sts=4:/** * phpMyAdmin sample configuration, you can use it as base for * manual configuration. For easier setup you can use scripts/setup.php * * All directives are explained in Documentation.html and on phpMyAdmin * wiki <http://wiki.cihar.com>. *//* * This is needed for cookie based authentication to encrypt password in * cookie */ $cfg['blowfish_secret'] = 'sakia'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! *//* * Servers configuration */ $i = 0;/* * First server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; /* Select mysqli if your server has it */ $cfg['Servers'][$i]['extension'] = 'mysql'; /* User for advanced features */ $cfg['Servers'][$i]['controluser'] = 'root'; $cfg['Servers'][$i]['controlpass'] = 'root'; /* Advanced phpMyAdmin features */ // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; // $cfg['Servers'][$i]['booktable'] = 'pma_book'; // $cfg['Servers'][$i]['relation'] = 'pma_relation'; // $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; // $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; // $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; // $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; // $cfg['Servers'][$i]['history'] = 'pma_history'; // $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';/* * End of servers configuration *//* * Directories for saving/loading files from server */ $cfg['UploadDir'] = ''; $cfg['SaveDir'] = '';?>但是有一个问题就是在phpinfo.php信息栏里并没有有关mysql的信息描述。请问这是怎么回事?
那请问,我现在去掉php.ini中“;extension=php_mysql.dll”前面的“;”,还是用第一楼提供的connect.php,我从IE运行 http://localhost/sample/connect.php. 出现如下错误:PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP\ext\php_mysql.dll' - 内存分配访问无效。 in Unknown on line 0 PHP Fatal error: Call to undefined function mysql_connect() in D:\sample\connect.php on line 2该如何解决呢?
OK 提供如下信息:你的PHP安装目录 你的APACHE安装目录(如果是IIS,就#$&#^$%&!#!%@#%^@!$%^#$*@!) 你的 php.ini 中 关于 extension path 内容.
谢谢chf00()的建议哈,我会去看的! 我的系统是装在E盘,php装在根目录下,E:\php\ 用的是 IIS 你所说的extension path是不是php.ini中;;;;;;;;;;;;;;;;;;;;;; ; Dynamic Extensions ; ;;;;;;;;;;;;;;;;;;;;;; ; ; If you wish to have an extension loaded automatically, use the following ; syntax: ; ; extension=modulename.extension ; ; For example, on Windows: ; ; extension=msql.dll ; ; ... or under UNIX: ; ; extension=msql.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. ; Windows Extensions ; Note that ODBC support is built in, so no dll is needed for it. ; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5) ; extension folders as well as the separate PECL DLL download (PHP 5). ; Be sure to appropriately set the extension_dir directive.;extension=php_bz2.dll ;extension=php_curl.dll ;extension=php_dba.dll ;extension=php_dbase.dll ;extension=php_exif.dll ;extension=php_fdf.dll ;extension=php_gd2.dll ;extension=php_gettext.dll ;extension=php_gmp.dll ;extension=php_ifx.dll ;extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_ldap.dll ;extension=php_mbstring.dll ;extension=php_mcrypt.dll ;extension=php_mhash.dll ;extension=php_mime_magic.dll ;extension=php_ming.dll ;extension=php_msql.dll ;extension=php_mssql.dll extension=php_mysql.dll ;extension=php_mysqli.dll ;extension=php_oci8.dll ;extension=php_openssl.dll ;extension=php_pdo.dll ;extension=php_pdo_firebird.dll ;extension=php_pdo_mssql.dll ;extension=php_pdo_mysql.dll ;extension=php_pdo_oci.dll ;extension=php_pdo_oci8.dll ;extension=php_pdo_odbc.dll ;extension=php_pdo_pgsql.dll ;extension=php_pdo_sqlite.dll ;extension=php_pgsql.dll ;extension=php_pspell.dll ;extension=php_shmop.dll ;extension=php_snmp.dll ;extension=php_soap.dll ;extension=php_sockets.dll ;extension=php_sqlite.dll ;extension=php_sybase_ct.dll ;extension=php_tidy.dll ;extension=php_xmlrpc.dll ;extension=php_xsl.dll ;extension=php_zip.dll
; Directory in which the loadable extensions (modules) reside. extension_dir = "E:/php/ext/"注意 php/ext 文件夹是否存在 php_mysql.dll 文件另:相关的 libmysql.dll 及libmys*.* 要COPY到 %SYSTEM% 目录下....晕死.为什么不用APACHE??? http://download.csdn.net/user/mrshelly
我自己搜索了好多,就是纳闷解决不了问题,单独用mysql,我可以创表,添加等操作都可以。但安装了PHP后,虽然仍可以单独工作,但是一些与PHP联接的就是不行。用http://localhost/ 也不能打开。还有就是mysqladmin也不能用。根据网上的资料,我复制了php5ts.dll和libmysql.dll到windows32中,也改了config.inc.php配置,如下:<?php/* $Id: config.sample.inc.php 9689 2006-11-10 20:05:49Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use scripts/setup.php
*
* All directives are explained in Documentation.html and on phpMyAdmin
* wiki <http://wiki.cihar.com>.
*//*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'sakia'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! *//*
* Servers configuration
*/
$i = 0;/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = 'root';
/* Advanced phpMyAdmin features */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['booktable'] = 'pma_book';
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
// $cfg['Servers'][$i]['history'] = 'pma_history';
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';/*
* End of servers configuration
*//*
* Directories for saving/loading files from server
*/
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';?>但是有一个问题就是在phpinfo.php信息栏里并没有有关mysql的信息描述。请问这是怎么回事?
php.ini,我也是依据网上的一些资料处理了,如下:register_globals=Off 修改为 register_globals=On
extension_dir="./_" 修改为 extension_dir="C:\php\ext"但是有一部分不一样,就是;extension= 部分,以及其他的各行前面的“;”就不能去掉,包括“;extension=php_mysql.dll”,因为一旦去掉,编译的时候就又出现PHP Warning: PHP Startup: Unable to load dynamic library等找不到扩展库的错误。
helloworld.php和phpinfo.php能运行,说明php是没问题的;能单独在mysql里添加删除数据,MySQL是没问题的;先看有没有语法错误,一看你写的代码就知道没有良好的编码规范,写多了就容易粗心出语法错误;但就这个问题来看,不是语法的问题,只是php连数据库时出错了,好好检查你的php.ini中关于MySQL的设置,这种情况一般出现在你安装php时没有把支持MySQL的模块加载进去。NT下默认是加载的,只有在UNIX/Linux环境下手工编译时才会忘记加载,而你也没有说你是什么环境,所以说你给的信息不够...另外你的那个mysql_fetch_array()的用法好象还有点问题以后在问问题之前,要精确有效地说明问题情况,建议你好好读读这篇文档
http://community.csdn.net/IndexPage/SmartQuestion.aspx 提问的智慧
提供如下信息:你的PHP安装目录
你的APACHE安装目录(如果是IIS,就#$&#^$%&!#!%@#%^@!$%^#$*@!)
你的 php.ini 中 关于 extension path 内容.
我的系统是装在E盘,php装在根目录下,E:\php\
用的是 IIS
你所说的extension path是不是php.ini中;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=msql.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.
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_msql.dll
;extension=php_mssql.dll
extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_pdo.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll
extension_dir = "E:/php/ext/"注意 php/ext 文件夹是否存在 php_mysql.dll 文件另:相关的 libmysql.dll 及libmys*.* 要COPY到 %SYSTEM% 目录下....晕死.为什么不用APACHE???
http://download.csdn.net/user/mrshelly
libmysql.dll安装时已拷贝,在mysql安装目录下就是没找libmys*.*类似的文件.不知道怎么回事?APACHE?我有安装Tomcat5.5
Apache Tomcat最好和JSP一起用
Apache httpd最好和PHP一起用结果你是IIS,Tomcat,PHP,MySQLApache+PHP+MySQL才是黄金搭档...
又是 IIS 又是 Tomcat 你先确认自己的WEB服务倒底是哪个软件提供的先..
这些东西不一次性 讲清楚.
非要象牙膏一样. 挤一下出来一点,挤一下出来一点...我是不想讨论了...后面的人继续.....