0

I am trying to run below php file using Putty in wordpress.

php-cgi -f info.php 

But this command throw this error Undefined index: SCRIPT_NAME.

Server Setting:

 #fastcgi_param HTTPS $fastcgi_https; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; 

Please help me to fix this issue.

7
  • Could it be that SCRIPT_NAME and SCRIPT_FILENAME aren't the same thing? Commented Sep 6, 2017 at 7:17
  • I think both are different. SCRIPT_NAME its file name and SCRIPT_FILENAME is the full path of file Commented Sep 6, 2017 at 7:19
  • You missed the intent of my comment. The undefined index is for SCRIPT_NAME, while you pass SCRIPT_FILENAME to the params. Commented Sep 6, 2017 at 7:21
  • We are getting issue on wp-includes/load.php on line100. here is code: // Fix for Dreamhost and other PHP as CGI hosts if ( strpos( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) !== false ) Commented Sep 6, 2017 at 7:26
  • 1
    It is usually defined as fastcgi_param SCRIPT_NAME $fastcgi_script_name; inside the fastcgi_params file. Commented Sep 6, 2017 at 9:29

1 Answer 1

0

There was an update to nginx or php (can't remember which broke it), but you need two entries in your fastcgi_params:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; 

At least, that's how -we- fixed it here. Give it a shot and let me know :)

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.