php curl模块调用apache wsgi应用程序

I have setup a django application using mod-wsgi and apache. This application is tested and is working fine from the linux curl module. However when this application is being called by php code through curl library , i get the response as "\x1f\x8b\b" instead of the intended xml response.

Both the php and python applications are running on the same machine with different ports.

I have tried searching online for help but of no use as i am lacking the knowledge of how apache behaves in this situation. Any help on this is appreciated. Please let me know if any further details are needed.

Update: I have narrowed down the problem to fewer parameters. I have completely eliminated the apache/django/wsgi application running on the port 8000. Now the php application running through port 80 just attempts (php curl) to retrieve a static text file through port 8000.

Even in this case the problem persists and the response string returned is still the same "\x1f\x8b\b" . One strange thing to note is, in both the cases (django application or static file) the http response code returned is 200. I tried loading a non-existent static file and noticed the response code to be 404 and the response still the same.

Apache is listening on both 80 and 8000 ports.

netstat -antp | grep "80"

tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      4348/python     
tcp6       0      0 :::80                   :::*                    LISTEN      1183/apache2    
tcp6       0      0 :::8000                 :::*                    LISTEN      1183/apache2    

So should be some issue with apache which i am missing. Please help.

Thanks.

I solved the issue. The problem was basically the php curl call which i am using is getting the response in gzip format. This was not happening in the linux curl call as it automatically uncompresses the response before writing out.

I only had to disable the deflate module in apache.

a2dismod deflate

It worked like a charm. Now the static files and also the django/wsgi application are working smoothly.

Thanks.