From: <php...@li...> - 2010-05-26 03:52:08
|
Marta, I don't know if this will help but when I was setting up my PHP application I had similar issues when trying to use my usual MySQL/PHP routines and rather then play with the configuration I wrote this up: function get_users(){ //Get Use Table From MySQL //Setup Driver $drivermanager = new JavaClass('java.sql.DriverManager'); //Statement Holder $select1 = new JavaClass('java.sql.Statement'); //Result Holder $resultSet = new JavaClass('java.sql.ResultSet'); //Connect $conn1 = $drivermanager->getConnection("jdbc:mysql://localhost:3306/etc...") or die("Unable to connect to MySQL"); //Issue Command $select1 = $conn1->createStatement(); $resultSet = $select1->executeQUERY("SELECT * FROM u_data"); //Return Results return $resultSet; } ~Matt > > Hi! > > Thanks to the PHP/Java Bridge I managed to get my PHP > applications running under Tomcat 6 (OS: Windows 7). The problem is, I > can't seem to > connect MySQL with PHP. > I installed MySQL, added PHP's home directory and \ext directory to the > PATH environment variable, and uncommented the extension lines for > php_mysql.dll and > php_mysqli.dll in php.ini. After doing that my PHP applications stopped > working. I decided to comment the extension lines again and as soon as I > did that my PHP applications started working again (but obviously I > can't use MySQL). I did this a few times just to make sure the problem > lied in those two extension lines. > I keep getting the following > error: > > HTTP Status 500 - type > Exception report > message > description The > server encountered an internal error () that prevented it from > fulfilling this request. > exception > javax.servlet.ServletException: PHP FastCGI instance failed. > php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:957) > php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:991) > php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:1040) > javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > root > cause > php.java.servlet.fastcgi.ConnectionException > php.java.servlet.fastcgi.FastCGIInputStream.read(FastCGIInputStream.java:52) > php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:876) > php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:944) > php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:991) > php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:1040) > javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > root > cause > java.io.IOException: Protocol error > php.java.servlet.fastcgi.FastCGIInputStream.doRead(FastCGIInputStream.java:61) > php.java.servlet.fastcgi.FastCGIInputStream.read(FastCGIInputStream.java:48) > php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:876) > php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:944) > php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:991) > php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:1040) > javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > > If anyone could help me I'd be very thankful as I need Tomcat, PHP and > MySQL working together in order to do my job. > > Sincerely, > > Marta Fernandes > _________________________________________________________________ > Hotmail: Free, trusted and rich email service. > https://signup.live.com/signup.aspx?id=60969 > ------------------------------------------------------------------------------ > > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |