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?
2 s
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.