Support » Installing WordPress » Installation Success – Finally – Tips for NGINX installs

  • Resolved pipstar


    Hey, I recently installed WordPress MU on an NGINX webserver and after much trial and error, everything is working beautifully

    (This install for WPMU is hosted under a subdomain and will use a subdirectory structure for the blogs).

    Note: Initially I had to add in / to

    define('PATH_CURRENT_SITE', '/' );
    in wp-config.php to fix up the fatal error below:

    Could Not Find Blog!
    Searched for in database name

    Then, my problems were with my nginx configuration.

    I played a lot with various rewrite options and debugged wordpress for several hours.

    In the end thanks to this blog entry I realised that I had setup my location ~ \.php$ { configuration was wrong.

    I needed this setup:

    # pass the PHP scripts to FastCGI server listening on
    	location ~ \.php$ {
     root /usr/share/wpmu;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_NAME      $fastcgi_script_name;
          fastcgi_param  REQUEST_URI      $request_uri;
          fastcgi_param  DOCUMENT_URI     $document_uri;
          fastcgi_param  DOCUMENT_ROOT    $document_root;
          fastcgi_param  REMOTE_ADDR        $remote_addr;
          fastcgi_param  REMOTE_PORT        $remote_port;
          fastcgi_param  SERVER_ADDR        $server_addr;
          fastcgi_param  SERVER_PORT        $server_port;
          fastcgi_param  SERVER_NAME        $server_name;
          fastcgi_param  SCRIPT_FILENAME  /usr/share/blogpath$fastcgi_script_name;
          fastcgi_param  QUERY_STRING     $query_string;
          fastcgi_param  REQUEST_METHOD   $request_method;
          fastcgi_param  CONTENT_TYPE     $content_type;
          fastcgi_param  CONTENT_LENGTH   $content_length;

    And with that setup I found that the nginx rewrite rules in the Codex worked perfectly.

    Good luck getting WPMU installed

  • The topic ‘Installation Success – Finally – Tips for NGINX installs’ is closed to new replies.