0
votes

I have a problem with my local Apache. When I start the service, the error.log of my Apache is full of:

piped log program 'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/bin/rotatelogs.exe C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/access-%Y-%m-%d.log 86400 +120' failed unexpectedly

"C:\Program" is not recognized as an internal or external command...

Does anyone know what the problem is? I suppose the reason is the space-character in the path. My httpd.conf looks like this:

CustomLog "|C:/Program Files (x86)/Apache Software Foundation/Apache2.2/bin/rotatelogs.exe C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/access-%Y-%m-%d.log 86400 +120" common
ErrorLog "|C:/Program Files (x86)/Apache Software Foundation/Apache2.2/bin/rotatelogs.exe C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/error-%Y-%m-%d.log 86400 +120"

As I write it in quote signs, I thought the blanks would be no problem. Can anyone help here?

I use Apache 2.2.22

1
Does it work if you set a var (like APACHE_HOME=C:/Program Files (x86)/Apache Software Foundation/Apache2.2) and run it this way ? - merours
Thank you for the reply. Did try, made no difference :( - Alex K.

1 Answers

0
votes

The path contains space. In this case should be quoted:

'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/bin/rotatelogs.exe'

Full sample:

ErrorLog "|'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/bin/rotatelogs.exe' 'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/error-%Y-%m-%d.log' 86400 +120"

Additionally, the rotatelog path can be referred by relative path:

ErrorLog "|bin/rotatelogs.exe 'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/error-%Y-%m-%d.log' 86400 +120"