Problem with running php script using mysql on tomcat
I am using tomcat 6 with JavaBridge. I have stored my php script in the following location.
C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\project\test.php
In test.php I am using curl and mysql. The php.ini in JavaBridge is stored in the following location
C:\Program Files\apache-tomcat-6.0开发者_StackOverflow中文版.26\webapps\JavaBridge\WEB-INF\cgi\php.ini
and its contents are -
extension_dir="C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\cgi\x86-windows\ext"
include_path="C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\pear;."
there is also a config file called mysql.ini whose contents are -
extension = php_mysql.dll
I had also installed wamp earlier so I copied all the dll's from C:\wamp\bin\php\php5.3.0\ext to C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\cgi\x86-windows\ext
When I start tomcat and run my script I get the following error -
Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\project\test.php on line 534
Please help.
If not enabled you have to enable curl in php.ini
by uncommenting:
extension=php_curl.dll
I solved the problem...actually my wamp has php 5.3.0 and the JavaBridge php.info() says its is 5.3.1. I copied the new dll's and it is working now. Now I get an error: undefined function curl_init(). For the benefit for someone who is also facing the same problem. I copied the following dll's -
libeay32.dll
ssleay32.dll
into C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\cgi and wrote the following line into mysql.ini
extension = php_curl.dll
and copied php_curl.dll into C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\cgi\x86-windows\ext
精彩评论