LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-30-2012, 03:18 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
what is the right way to create debug messages in php (the interpreter itself)?


Hi!

I'm hacking php (the interpreter itself) and I have created a number of fprintf(stderr, "blahblah", blah, blah) messages that work like a charm in php cli but now I want to debug it in apache. How is it done? I noticed my messages don't show up either in apache's error.log or access.log so I guess I'm either looking at the wrong place or it's not the right way to do it.

Thanks in advance

Last edited by eantoranz; 07-30-2012 at 03:23 PM.
 
Old 07-30-2012, 04:49 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
ap_log_error() seems to be the way to do it.

I have included http_log.h in the c file I'm working on but now I get this:

Code:
/usr/include/apache2/http_log.h:94:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ap_default_loglevel’
/usr/include/apache2/http_log.h: In function ‘AP_DECLARE’:
/usr/include/apache2/http_log.h:102:18: error: expected declaration specifiers before ‘ap_open_stderr_log’
/usr/include/apache2/http_log.h:109:1: error: expected declaration specifiers before ‘AP_DECLARE’
/usr/include/apache2/http_log.h:122:37: error: unknown type name ‘server_rec’
/usr/include/apache2/http_log.h:171:1: error: expected declaration specifiers before ‘AP_DECLARE’
/usr/include/apache2/http_log.h:195:1: error: expected declaration specifiers before ‘AP_DECLARE’
/usr/include/apache2/http_log.h:219:1: error: expected declaration specifiers before ‘AP_DECLARE’
/usr/include/apache2/http_log.h:245:1: error: expected declaration specifiers before ‘AP_DECLARE’
/usr/include/apache2/http_log.h:254:1: error: expected declaration specifiers before ‘AP_DECLARE’
/usr/include/apache2/http_log.h:261:1: error: expected declaration specifiers before ‘AP_DECLARE’
/usr/include/apache2/http_log.h:269:1: error: expected declaration specifiers before ‘AP_DECLARE’
/usr/include/apache2/http_log.h:272:26: error: storage class specified for parameter ‘piped_log’
/usr/include/apache2/http_log.h:280:1: warning: empty declaration [enabled by default]
/usr/include/apache2/http_log.h:305:1: error: expected declaration specifiers before ‘AP_DECLARE’
/usr/include/apache2/http_log.h:314:1: error: expected declaration specifiers before ‘AP_DECLARE’
/usr/include/apache2/http_log.h:322:1: error: expected declaration specifiers before ‘AP_DECLARE’
/usr/include/apache2/http_log.h:350:1: error: expected declaration specifiers before ‘AP_DECLARE_HOOK’
Plus a lot of other stuff.

What's going on?
 
Old 07-30-2012, 05:02 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
Ok.... a few includes where missing:

Code:
#include <apr.h>
#include <httpd.h>
#include <ap_config.h>
#include <http_log.h>
But I'm missing a typedef:

Code:
/usr/include/apr-1.0/apr.h:362:1: error: unknown type name ‘off64_t’
Line in question in apr.h?
Code:
typedef  off64_t           apr_off_t;
What am I missing now?
 
Old 07-30-2012, 05:18 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
I have included sys/types.h but I still get the same error.

Code:
#include <sys/types.h>
#include <apr.h>
#include <httpd.h>
#include <ap_config.h>
#include <http_log.h>
 
Old 08-01-2012, 01:13 AM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 1,817

Rep: Reputation: 505Reputation: 505Reputation: 505Reputation: 505Reputation: 505Reputation: 505
Compile with option -D_LARGEFILE_SOURCE
 
  


Reply

Tags
debug, fprintf, messages, php


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a new stream type for php (the interpreter itself) eantoranz Programming 0 07-27-2012 03:34 PM
[SOLVED] ssh Connection reset by peer -- Suggestions for getting debug messages? pcardout Linux - Networking 5 07-06-2012 02:51 AM
How to reduce LVM messages in /var/log/debug? catkin Linux - General 5 07-27-2011 01:46 PM
jack : how to disable verbose debug messages angelo_maci Linux - Software 2 06-18-2010 04:10 AM
Turning on/off debug messages galapogos Linux - Kernel 0 07-20-2008 11:10 PM


All times are GMT -5. The time now is 07:26 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration