0

I'm wanting to switch to mpm_event to be able to serve a higher rate of requests. My initial testing showed that the server can serve a higher rate of requests when using mpm event. The server is basically just serving files, but there is a php application running on the server. I've been using prefork up until now. The php application uses the apache_note() function to insert some information into the apache logs. When I run mpm_event, this functionality seems to break (function not found). Is mpm_event compatible with apache_note(), or should I use some other method to insert data into the logs?

1 Answer 1

2

Certain functions, like apache_note(), are only available when PHP runs as an Apache module. Using this, or anything specific to mod_php, is usually a bad idea due to lock-in. Consider using a standard function like trigger_error() instead. It was specifically designed for what you want to do, unlike apache_note().

5
  • Is there a function that can be used to insert general information into the logs? My use case is that I grab the username from the request and add it into the log. Commented Oct 2, 2018 at 16:00
  • I think maybe just using headers would accomplish the same task? Commented Oct 2, 2018 at 21:26
  • Apache has a very rich log format. Depending on the design of your application, it may be able to log your desired data alone without any help from PHP. Commented Oct 3, 2018 at 3:37
  • Issue is that I decrypt a cookie to pull the userid out. This is done with PHP and then added to the logs. Commented Oct 4, 2018 at 16:29
  • @yossarian2004 You probably should be keeping your own logs. Sticking this stuff in the Apache log is kind of messy. Commented Oct 4, 2018 at 18:52

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.