./configure  --with-mysql=/usr/lib/mysql --with-zlib-dir=/usr/local/zlib 
make
make install
这是我安装php的命令,没有提示任何错误。
我用php在服务器端写了个函数,里面访问mysql,单独运行该脚本,正常执行,但是在客户端用soap调用该函数就出现下面的错误:
Call to undefined function mysql_connect()大家帮帮忙啊,整了一下午了……

解决方案 »

  1.   

    你除了安装mysql, 还得安装mysql的php版开发包, 在服务器下有个扩展叫mysql.so或mysqld.so之类的你可以在终端试下$ echo '<? phpinfo() ?>' > test.php然后用你的方式去执行test.php文件, 看下里面有没安装到mysql扩展。
      

  2.   


    这是加载的模块
    Loaded Modules  core prefork http_core mod_so mod_auth_basic mod_auth_digest mod_authn_file mod_authn_alias mod_authn_anon mod_authn_dbm mod_authn_default mod_authz_host mod_authz_user mod_authz_owner mod_authz_groupfile mod_authz_dbm mod_authz_default util_ldap mod_authnz_ldap mod_include mod_log_config mod_logio mod_env mod_ext_filter mod_mime_magic mod_expires mod_deflate mod_headers mod_usertrack mod_setenvif mod_mime mod_dav mod_status mod_autoindex mod_info mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_actions mod_speling mod_userdir mod_alias mod_substitute mod_rewrite mod_proxy mod_proxy_balancer mod_proxy_ftp mod_proxy_http mod_proxy_ajp mod_proxy_connect mod_cache mod_suexec mod_disk_cache mod_cgi mod_version mod_dnssd mod_php5 我搜了一下,我系统中有3个mysql.so,还有2个pdo_mysql.so
      

  3.   

    已安装的软件包
    MySQL-client.i386                     5.5.17-1.linux2.6            @/MySQL-client-5.5.17-1.linux2.6.i386  
    MySQL-devel.i386                      5.5.17-1.linux2.6            @/MySQL-devel-5.5.17-1.linux2.6.i386   
    MySQL-embedded.i386                   5.5.17-1.linux2.6            @/MySQL-embedded-5.5.17-1.linux2.6.i386
    MySQL-server.i386                     5.5.17-1.linux2.6            @/MySQL-server-5.5.17-1.linux2.6.i386  
    MySQL-shared.i386                     5.5.17-1.linux2.6            @/MySQL-shared-5.5.17-1.linux2.6.i386  
    MySQL-test.i386                       5.5.17-1.linux2.6            @/MySQL-test-5.5.17-1.linux2.6.i386    
    可安装的软件包
    MySQL-python.i686                     1.2.3-1.fc14                 updates                                
    MySQL-zrm.noarch                      2.1.1-7.fc14                 fedora                                 
    mysql.i686                            5.1.58-1.fc14                updates                                
    mysql++.i686                          3.1.0-2.fc14                 fedora                                 
    mysql++-devel.i686                    3.1.0-2.fc14                 fedora                                 
    mysql++-manuals.i686                  3.1.0-2.fc14                 fedora                                 
    mysql-bench.i686                      5.1.58-1.fc14                updates                                
    mysql-connector-c++.i686              1.1.0-0.4.bzr895.fc14        updates                                
    mysql-connector-c++-devel.i686        1.1.0-0.4.bzr895.fc14        updates                                
    mysql-connector-java.i686             1:5.1.15-1.fc14              updates                                
    mysql-connector-odbc.i686             5.1.5r1144-7.fc13            fedora                                 
    mysql-connector-python.noarch         0.3.2-2.fc14                 updates                                
    mysql-connector-python3.noarch        0.3.2-2.fc14                 updates                                
    mysql-devel.i686                      5.1.58-1.fc14                updates                                
    mysql-embedded.i686                   5.1.58-1.fc14                updates                                
    mysql-embedded-devel.i686             5.1.58-1.fc14                updates                                
    mysql-libs.i686                       5.1.58-1.fc14                updates                                
    mysql-mmm.noarch                      2.2.1-1.fc14                 fedora                                 
    mysql-mmm-agent.noarch                2.2.1-1.fc14                 fedora                                 
    mysql-mmm-monitor.noarch              2.2.1-1.fc14                 fedora                                 
    mysql-mmm-tools.noarch                2.2.1-1.fc14                 fedora                                 
    mysql-proxy.i686                      0.8.1-1.fc14                 updates                                
    mysql-proxy-devel.i686                0.8.1-1.fc14                 updates                                
    mysql-server.i686                     5.1.58-1.fc14                updates                                
    mysql-test.i686                       5.1.58-1.fc14                updates                                
    mysql-utilities.noarch                1.0.1-0.5.2.35.fc14          updates                                
    mysql-workbench.i686                  5.2.35-1.fc14                updates                                
    mysqlreport.noarch                    3.5-4.fc12                   fedora                                 
    mysqltuner.noarch                     1.1.1-1.fc13                 fedora                                 
    mysqludf_xql.i686                     1.0.0-1.fc13                 fedora                                 
      

  4.   


    如果这是服务器加载的模块,那么里面没有mod_mysql , mod_mysqld 之类的就是没加载到, 或安装成功。
    还有重启服务器。