Change order header apache - php

how to change order header the following line
HTTP/1.1 200 OK
Date: Sat, 24 Aug 2013 05:10:06 GMT
Content-Length: 0
Server: apache
Pragma: no-cache
X-Powered-By: PHP5
to :
HTTP/1.1 200 OK
Pragma: no-cache
Content-Length: 0
Server: apache
X-Powered-By: PHP5
Date: Sat, 24 Aug 2013 05:10:06 GMT
in apache

Related

Wordpress Site not Connecting thru online Cron Job Service

I am running a wordpress site and using an online cron job service to connect.
When i connect thru the service im getting "HTTP/1.1 404 Not Found" error.
This is the cron job link im using:
http://www.moongot.com/wp-content/plugins/WPFanMachineBasic/auto.php
This is the output:
X-Powered-By: PHP/5.5.22 Pragma: no-cache Date: Sat, 14 Apr 2018
22:00:59 GMT Content-Length: 4 Server: Apache/2 Set-Cookie:
PHPSESSID=3ef1b912c68e0502d03caccb87e0858b; path=/ Expires: Wed, 11
Jan 1984 05:00:00 GMT Cache-Control: no-cache, must-revalidate,
max-age=0 X-Endurance-Cache-Level: 2 Content-Type: text/html;
charset=UTF-8
DONE
I get the same via cURL:
curl -I http://www.moongot.com/wp-content/plugins/WPFanMachineBasic/auto.php
HTTP/1.1 404 Not Found
Date: Sat, 14 Apr 2018 22:29:13 GMT
Content-Type: text/html
Content-Length: 863
Connection: keep-alive
Keep-Alive: timeout=30
Server: Apache/2
X-Powered-By: PHP/5.5.22
Set-Cookie: PHPSESSID=2df00eb1132bf607a708d00aee845f8a; path=/
Pragma: no-cache
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Last-Modified: Wed, 02 Aug 2017 19:17:35 GMT
Accept-Ranges: bytes
and in Chrome:
So you'll want to figure out why your auto.php file is spitting out a 404 header.

PHP "Cache-Control" header and Nginx

Got php file:
<?
$maxAge = 2592000;
header ("Content-Type: application/x-javascript; charset=utf-8");
header ("Last-Modified: Thu, 19 Jul 2012 12:56:03 GMT");
header ("Expires: " . gmdate ('D, d M Y H:i:s \G\M\T', time () + $maxAge));
header ("Cache-Control: max-age=" . $maxAge);
Headers, when use local apache server
$curl -I http://localhost/js/js.php
HTTP/1.1 200 OK
Date: Thu, 16 Jul 2015 12:07:47 GMT
Server: Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.1
Last-Modified: Thu, 19 Jul 2012 12:56:03 GMT
Expires: Sat, 15 Aug 2015 12:07:47 GMT
Cache-Control: max-age=2592000
Content-Type: application/x-javascript; charset=utf-8
When check on web (Nginx):
$ curl -I http://***/js/js.php
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 16 Jul 2015 12:15:21 GMT
Content-Type: application/x-javascript; charset=utf-8
Connection: keep-alive
Keep-Alive: timeout=10
X-Powered-By: PHP/5.3.8
Last-Modified: Thu, 19 Jul 2012 12:56:03 GMT
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Cache-Control: no-cache
How can I enable Cache-Control from PHP headers?

Chrome totally ignoring Access-Control-Allow-Origin: * header

I am setting this with htaccess. I know it's being set properly because if I set another header:
Header set Access-Control-Allow-Origin2: *
Then chrome does see this. As soon as I remove the 2 however, chrome just completely ignores it. If I make my file a PHP file and put this in it:
<?php header("Access-Control-Allow-Origin: *"); ?>
Then it works.
Here are the response headers as reported by Chrome of the .htaccess method which I need to work and which does not:
HTTP/1.1 304 Not Modified
Date: Sun, 30 Mar 2014 00:13:06 GMT
Server: Apache/2.2.22 (Ubuntu)
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
ETag: "208f3-178a2-4f5c4f119cd34"
Vary: Accept-Encoding
Here are the response headers as reported by Chrome from the PHP method which for some reason does work:
HTTP/1.1 200 OK
Date: Sun, 30 Mar 2014 00:13:09 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.3.10-1ubuntu3.10
Access-Control-Allow-Origin: *
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 23
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Content-Type: text/html
Again, I know the htaccess is setting the header, even if I go to an online service that checks reponse headers, I see this back:
HTTP/1.1 200 OK
Date: Sun, 30 Mar 2014 00:18:14 GMT
Server: Apache/2.2.22 (Ubuntu)
Last-Modified: Sat, 29 Mar 2014 20:48:34 GMT
ETag: "208f3-178a2-4f5c4f119cd34"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Access-Control-Allow-Origin: *
Content-Length: 33393
Content-Type: application/javascript

Google Document List API 308 Resume Incomplete

I am working with the Google Document List API to upload a file along with meta-data.
I have it working perfectly so long as the file is less than 512KB. After 512KB I have to send it in 512KB chunks. After each chunk I get a HTTP Status Code of 308 sent back, which is correct.
However, after I have sent the final request I still get a 308 response, instead of the 201 response I expect. Below are the HTTP Headers sent and received. Maybe someone else can see what I am missing.
POST /feeds/upload/create-session/default/private/full HTTP/1.1
Host: docs.google.com
Accept: */*
Content-Type: application/atom+xml
Authorization: Bearer <CODE>
GData-Version: 3.0
Content-Type: application/atom+xml
X-Upload-Content-Length: 1436480
X-Upload-Content-Type: text/csv
Content-Length: 302
HTTP/1.1 200 OK
Server: HTTP Upload Server Built on Sep 5 2012 17:14:59 (1346890499)
Location: https://docs.google.com/feeds/upload/create-session/default/private/full?upload_id=<ID>
Date: Fri, 14 Sep 2012 17:34:50 GMT
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate
Content-Length: 0
Content-Type: text/html; charset=UTF-8
PUT /feeds/upload/create-session/default/private/full?upload_id=<ID> HTTP/1.1
Host: docs.google.com
Accept: */*
Authorization: Bearer <CODE>
GData-Version: 3.0
Content-Type: text/csv
Content-Range: bytes 0-524288/1436480
Content-Length: 524288
Expect: 100-continue
HTTP/1.1 308 Resume Incomplete
Server: HTTP Upload Server Built on Sep 5 2012 17:14:59 (1346890499)
Range: bytes=0-524287
X-Range-MD5: 8f470cff00adda7c22b8b34287d2cc1b
Date: Fri, 14 Sep 2012 17:34:52 GMT
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate
Content-Length: 0
Content-Type: text/html; charset=UTF-8
PUT /feeds/upload/create-session/default/private/full?upload_id=<ID> HTTP/1.1
Host: docs.google.com
Accept: */*
Authorization: Bearer <CODE>
GData-Version: 3.0
Content-Type: text/csv
Content-Range: bytes 524288-1048576/1436480
Content-Length: 524288
Expect: 100-continue
HTTP/1.1 308 Resume Incomplete
Server: HTTP Upload Server Built on Sep 5 2012 17:14:59 (1346890499)
Range: bytes=0-1048575
X-Range-MD5: 4af215a3ff92258bb1c8d05dc52cf77d
Date: Fri, 14 Sep 2012 17:34:54 GMT
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate
Content-Length: 0
Content-Type: text/html; charset=UTF-8
PUT /feeds/upload/create-session/default/private/full?upload_id=<ID> HTTP/1.1
Host: docs.google.com
Accept: */*
Authorization: Bearer <CODE>
GData-Version: 3.0
Content-Type: text/csv
Content-Length: 387904
Expect: 100-continue
HTTP/1.1 308 Resume Incomplete
Server: HTTP Upload Server Built on Sep 5 2012 17:14:59 (1346890499)
Range: bytes=0-1048575
X-Range-MD5: 4af215a3ff92258bb1c8d05dc52cf77d
Date: Fri, 14 Sep 2012 17:34:55 GMT
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate
Content-Length: 0
Content-Type: text/html; charset=UTF-8
EDIT
Here are the last Headers if I make the Content Range be sent on the last PUT request.
PUT /feeds/upload/create-session/default/private/full?upload_id=<ID< HTTP/1.1
Host: docs.google.com
Accept: */*
Authorization: Bearer <CODE>
GData-Version: 3.0
Content-Type: text/csv
Content-Range: bytes 1048576-1436480/1436480
Content-Length: 387904
Expect: 100-continue
Got
HTTP/1.1 400 Bad Request
Server: HTTP Upload Server Built on Sep 5 2012 17:14:59 (1346890499)
Content-Type: text/html; charset=UTF-8
Date: Fri, 14 Sep 2012 19:12:06 GMT
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate
Content-Length: 15
Connection: close
It seems that your last request is not sending a Content-Range. I think this is the problem but am unsure because I have never used this API before. I'm just going off what I know in the HTTP spec.

C2DM device not receiving message

I get the following response when I try to send a message:
HTTP/1.1 200 OK
Content-Type: text/plain
Date: Sat, 31 Mar 2012 06:02:57 GMT
Expires: Sat, 31 Mar 2012 06:02:57
GMT Cache-Control: private, max-age=0
X-Content-Type-Options:
nosniff X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1;
mode=block Server: GSE
Connection: close
Error=MissingRegistration
What can the issue be? Please help.

Categories