mysql_connect 命令不识别后来发现info.php里面没有mysql模块 悲剧了 上网搜了很久 最后设置成这样 还是不行
mysql-5.1.44安装在 /usr/local/mysql
php-5.2.3安装在 /usr/local/php
httpd-2.2.16在  /usr/local/apache2
php安装过程:
php-5.2.3文件夹下编译
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql-dir=/usr/local/mysql --with-config-file-path=/usr/local/lib --enable-force-cgi-redirect --disable-cgi --with-zlib --with-gettext --with-gdbm# make            
# make test        
# make install 复制php.ini文件到/usr/local/lib配置路径
cp /root/phpd/php/php-5.2.3/php.ini-dist  /usr/local/lib/php.ini (/root/phpd/php/php-5.2.3是解压目录)修改php.ini的以下内容为On
register_globals = On然后修改httpd.conf文件
#DocumentRoot "/usr/local/apache2/htdocs" 此处为html文件主目录
#设置apache的默认文件名次序#AddType application/x-httpd-php .php .phtml .php3 .inc #AddType application/x-httpd-php-source .phps 之后又yum install php-mysql;yum install php-pdo;这样就添加了dbase.so  mysqli.so mysql.so pdo_mysql.so pdo.so pdo_sqlite.so phpcups.so 到文件夹/usr/lib/php/modules/下 (但是没有ldap.so 难道是这个问题?这个文件去哪里找?)
设定了php.ini里面extension_dir = "/usr/lib/php/modules"(分号也已经去掉了)
extension=php_mysql.dll 前面分号去掉
添加了:
extension=mysql.so
extension=mysqli.so
extension=pdo_mysql.so所有设置就是这样了 到底怎么回事??大家帮帮忙!!!

解决方案 »

  1.   

    apache 和mysql都能够独立运行!
      

  2.   

    看看/var/logs/httpd/error.log这里面是什么错误
      

  3.   

    看看/var/logs/httpd/error.log这里面是什么错误有/var/log/  后面没了 整个centos也没有error.log这个文件啊
      

  4.   

    那你看看httpd.conf里面的错误文件指向哪里.
      

  5.   


    有/var/log/ 后面没了 整个centos也没有error.log这个文件啊
      

  6.   

    你是哪个发行版啊
    比如fedora的话就用yum,基本不用任何配置就工作的很好了
      

  7.   


    今天运行下  把;extension=php_mssql.dll
    ;extension=php_mysql.dll这两个前面的分号加上了 之后还有错误如下:[Wed Aug 18 08:58:11 2010] [notice] SIGHUP received.  Attempting to restart
    PHP Warning:  PHP Startup: mysql: Unable to initialize module\nModule compiled with module API=20050922, debug=0, thread-safety=0\nPHP    compiled with module API=20060613, debug=0, thread-safety=0\nThese options need to match\n in Unknown on line 0
    PHP Warning:  PHP Startup: mysqli: Unable to initialize module\nModule compiled with module API=20050922, debug=0, thread-safety=0\nPHP    compiled with module API=20060613, debug=0, thread-safety=0\nThese options need to match\n in Unknown on line 0
    PHP Warning:  PHP Startup: pdo_mysql: Unable to initialize module\nModule compiled with module API=20050922, debug=0, thread-safety=0\nPHP    compiled with module API=20060613, debug=0, thread-safety=0\nThese options need to match\n in Unknown on line 0
    [Wed Aug 18 08:58:11 2010] [notice] Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8e-fips-rhel5 PHP/5.2.3 configured -- resuming normal operations
    [Wed Aug 18 08:58:57 2010] [error] [client 127.0.0.1] File does not exist: /usr/local/apache2/htdocs/favicon.ico
      

  8.   

    配置参数应该是这样
    ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/lib --enable-force-cgi-redirect --disable-cgi --with-zlib --with-gettext --with-gdbm