1

I have setup a wordpress blog at domain.com/blog using nginx. I can see all the wordpress pages and access the admin dashboard, and various admin pages. But, when I try to access 'edit.php', I am getting an error message displayed in the browser -

The input type is invalid

So, I turned the debug on and found in the logs -

Undefined offset: 1 in /home/projects/webapps/blog/wp-includes/vars.php on line 31

My nginx setup is -

server {
listen       80;
server_name  www.domain.com domain.com 22.22.22.22;

root /home/projects/webapps;

location /blog {
    index index.php index.html index.htm;
    try_files $uri $uri/ /blog/index.php?$args; 
}

location ~ \.php$ {
            fastcgi_split_path_info ^(/blog)(/.*)$; 
            include /etc/nginx/fastcgi.conf;  
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_param  SCRIPT_FILENAME  $request_filename;

    }

}
  • Have you always had this issue? Are you running any plugins that are related to the Pages menu? – Ethan Jinks O'Sullivan Aug 19 '16 at 3:24
  • No, just recently. The only active plugin is Yoast SEO. – filal_boult Aug 19 '16 at 3:30
  • an undefined offset shouldn't cause that issue, my guess is with your nginx config. something with the query string is off. – bynicolas Aug 19 '16 at 5:19
0

Ok I'm not sure this will fix your issue, but your error in your log (especially the file where it is called from) tells me it's a query vars issue likely from a bad regex or a bad routing of the request in your nginx config.

replace your line

fastcgi_split_path_info ^(/blog)(/.*)$;

with

fastcgi_split_path_info ^(.+\.php)(/.+)$;

and replace (this one I'm not sure it's required, but you could try it too)

fastcgi_param  SCRIPT_FILENAME  $request_filename;

with

fastcgi_param  SCRIPT_FILENAME  $document_root$request_filename;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.