Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:


Go Back   Caucho Forums > Quercus

Reply
 
Thread Tools Display Modes
  #1  
Old 11-25-2012, 05:00 PM
chubbsondubs chubbsondubs is offline
Junior Member
 
Join Date: Nov 2012
Posts: 2
Default How to get rid of mysql_fetch_object warning?

I keep getting this written into my HTML page:

Warning: function 'mysql_fetch_object' called with 2 arguments, but only expects 1 arguments [mysql_fetch_object]

And of course it doesn't return anything. I've taking an existing PHP application and trying to port it to Quercus. I'm also seeing this:

Warning: file name must not be null [error_log]

First question is why is mysql_fetch_object complaining since this is a valid invocation of this method? And second is there a way to have these warnings logged to a log file over putting it directly in the response output?
Reply With Quote
  #2  
Old 11-26-2012, 08:09 PM
nam nam is offline
Administrator
 
Join Date: Aug 2009
Posts: 337
Default

Hi,

What Quercus version are you using? I looked at our source code and our mysql_fetch_object() does support calls with 1 to 3 arguments, so I don't know what's going on.

And how exactly are you calling error_log()? I wouldn't be surprised if there's a bug or two because our error_log() is poorly implemented.

To log to files, you can use a Java logging framework to do so since Quercus logs everything to Java's java.util.Logger. If you're using Resin, then you can simply configure resin.xml or web.xml to tell Resin to output specific logs to a file. Let me know if you need more details.
Reply With Quote
  #3  
Old 11-26-2012, 08:22 PM
chubbsondubs chubbsondubs is offline
Junior Member
 
Join Date: Nov 2012
Posts: 2
Default

I'm using the latest Quercus v4.0.25. I fixed it by moving to the newer mysqli_ api since mysql_ has been deprecated in C PHP. Once I did that it starting working as expected. I actually converted to the new OOP version of the api.

Once I put the log location in the php.ini file, turned off displayErrors, added that to my web.xml it stopped having any problems. One thing I noticed was that it didn't write a newline to the log file after each log message. I added this to my web.xml.

Code:
<servlet>
      <servlet-name>Quercus Servlet</servlet-name>
      <servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class>
      <init-param>
        <param-name>ini-file</param-name>
        <param-value>WEB-INF/php.ini</param-value>
      </init-param>
</servlet>
And my php.ini:

Code:
display_errors = Off
error_log = /Users/charlie/lib/apache-tomcat-7.0.26/logs/php_errors.log
So far I think Quercus is great!
Reply With Quote
  #4  
Old 11-26-2012, 08:35 PM
nam nam is offline
Administrator
 
Join Date: Aug 2009
Posts: 337
Default

Cool, thanks for the support. I've filed a bug report for the log newline at:

http://bugs.caucho.com/view.php?id=5289

It should be an easy fix. Also, Quercus is currently at 4.0.33. The Quercus page is a bit behind. You can download the latest version of Quercus with Resin at http://www.caucho.com/download. The resin/lib/resin.jar is all you need.
Reply With Quote
  #5  
Old 04-05-2013, 02:33 AM
nam nam is offline
Administrator
 
Join Date: Aug 2009
Posts: 337
Default

error_log() is fixed for 4.0.36.
Reply With Quote
Reply

Tags
mysql, mysql_fetch_object, warnings

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:10 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.