6

Is it possible to install WordPress on a public server that doesn't have a domain name configured yet? I thought I'd set it up on IP-only, and had the line server_name _; in my Nginx configuration. I think it's because of this that the WordPress installation dies at wp-admin/install.php?step=2 and I see the following error in the Nginx logs:

2017/01/08 07:24:53 [error] 25686#25686: *22 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught phpmailerException: Invalid address: wordpress@_ in /home/ankush/wp_main_site/wp-includes/class-phpmailer.php:946
Stack trace:
#0 /home/ankush/wp_main_site/wp-includes/pluggable.php(352): PHPMailer->setFrom('wordpress@_', 'WordPress', false)
#1 /home/ankush/wp_main_site/wp-admin/includes/upgrade.php(395): wp_mail('dkasolutions.sa...', 'New WordPress S...', 'Your new WordPr...')

Is a domain name a must or am I doing something wrong?

1

Set server_name to the IP address, eg:

server {
    listen   80;
    server_name 0.1.2.3;
    // other stuff
}

You could also leave it out, because the default in ngninx is an empty string. But then all those pieces in WordPress that don't validate $_SERVER['SERVER_NAME'] and similar values … will just break.

See ticket #25239 for the progress on this front.

If only WordPress had a Request object, like everyone else. Then it would be easy to prepare all these global values. See Symfony for an example.

  • If only WordPress had a Request object, like everyone else. I don't know Symphony, but WordPress has WP_Http class. What is missing in there? – prosti Jan 8 '17 at 9:45
  • @prosti That's a completely different thing. A Request object provides a standardized interface for the (sanitized) request data. It also makes tests easier, because you can simulate different requests. – fuxia Jan 8 '17 at 9:48
  • @prosti You are aware that this is just a placeholder? – fuxia Jan 8 '17 at 9:53
  • Yes, but someone will copy paste and better to use 1.2.3.4 @toscho – prosti Jan 8 '17 at 19:38
  • @prosti How is 1.2.3.4 better then? It is wrong too. If you are able to edit that file, you should know what you are doing. This is a developer site. – fuxia Jan 8 '17 at 19:41
0

Is it possible to install WordPress on a public server that doesn't have a domain name configured yet?

Yes.

I thought I'd set it up on IP-only, and had the line server_name _; in my Nginx configuration.

You can use server name you like, for instance.

server_name tattarrattat.com;

Your WordPress installation can be aware of the server name tattarrattat.com.

On your end you can set inside your /etc/hosts file something like this.

1.2.3.4 tattarrattat.com

Where 1.2.3.4 is your server IP address. So even thought you test on a remote server you use the domain you like.


You may also use Virtual Hosts extension in Chrome, when previewing the web site on your end.

  • I've looked into this solution but changing hosts file isn't always possible, especially when you have to show the website in progress to clients. I needed something that will work right out of the box. – ankush981 Jan 9 '17 at 8:55
  • It depends on how you define right out of the box? I am just providing some tips from the heart. Should be good when creating website test environment clones. – prosti Jan 9 '17 at 18:09

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.