PHP / Java bridge problem

I am using Tomcat 6. I am running a php script using JavaBridge. I am getting the following error when running my code.

Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\xxxx\xxxxx.php on line 534

      

Please, help.

+2


a source to share


4 answers


I'm not really sure what I did, but mine worked when I read the documentation. in my case it is MySQL and I am using Tomcat 7.

  • copy the correct version of the php_mysql.dll PHP extension to the appropriate "ext" directory, in my case it is "C: \ Program Files \ Apache Software Foundation \ Tomcat 7.0 \ webapps \ aeu \ WEB-INF \ CGI \ amd64-windows \ ext"

  • uncomment / add this line,

    extension = php_mysql.dll



in php.ini and mysql.ini file, in my case there is C: \ Program Files \ Apache Software Foundation \ Tomcat 7.0 \ webapps \ aeu \ WEB-INF \ cgi \ amd64-windows \ php.ini and C: \ Program Files \ Apache Software Foundation \ Tomcat 7.0 \ webapps \ aeu \ WEB-INF \ cgi \ amd64-windows \ conf.d \ mysql.ini

and finally restart Tomcat. good luck.

+2


a source


I would do two things:



  • Make sure the location is php_mysql.dll

    included in the PATH

    env variable.
  • Open the file php.ini

    and look under extensions. Make sure the line to load php_mysql.dll

    is uncommented (make sure it's not there ;

    before it).
+1


a source


Probably for missing a missing one libmysql.dll

, try to find that file (Windows find might help) and make sure it's in the directory that you own your PATH. (see topic )

+1


a source


You may need to configure PHP with the option: --with-mysql = path_to_mysql

I would just like to emphasize Bruces' question regarding using the mysqli API (not the old mysql API)

0


a source







All Articles