Portal Home > Knowledgebase > Articles Database > Apache pipe to PHP script


Apache pipe to PHP script




Posted by SpookTech, 06-15-2007, 11:00 AM
Hi, ive read that apache can pipe log files into a PHP script. ive tried it and its not working. ive tried 2 ways, one pipes to the script file (which says to load with PHP.exe on the top line). the other way pipes to PHP.exe and tells it to load the script. i put a simple bit in my script to create a new file just to check if it worked and it looks like the script is never being run yet i dont get any errors from apache. could there be something im missing?

Posted by RBBOT, 06-15-2007, 12:32 PM
I've not looked at this feature, but I'm guessing you have to use a named pipe file descriptor on the file system rather than using a shell anoymous pipe (The | character). Create a pipe file, configure apache to write the pipe file, and write your script to read from it, then run the php script in a separate process. Here is an article on named pipes to get you started: http://www2.linuxjournal.com/article/2156

Posted by SpookTech, 06-15-2007, 06:14 PM
i dont quite understand what that page is saying but i dont want to run my script as a seperate process (i dont think). ive been happily using cronolog.exe for a while now. apache pipes the logs to it and it saves the logs in different files depending on the time and date. ive searched the net and a lot of places show examples of piping to scripts and ive tried to follow them very carefully yet its still not working. could this be because im on windows rather than linux? it possible but i would have thought if cronolog.exe works then php.exe should work too



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
openvz management (Views: 684)


Language: