1

I am trying to run a fresh install of wordpress using the php built-in sever via

php -S localhost:8000

When I visit localhost:8000 or the port number I supplied during creation it redirects me to localhost which is the default apache page. Meaning it basically hands control over to apache which is what I am avoiding in the first place. I have ran the same command in other php projects (laravel) and it works just fine. I am new to wordpress what up with it and this error?

For the record, I hate working from /var/www/html directory because it's annoying to deal with permissions during developement. I prefer to keep all my projects in a "projects" folder and serve on ports without any server hassle just like other langs like js (node).

I am on Ubuntu 16.04

4
  • 2
    Probably because you installed WordPress into localhost and WP saves the domain it was installed into in its database and uses it in all sorts of odd and anoying places Commented Oct 2, 2018 at 16:31
  • 1
    There should be a setting in your WP admin to change the base URL to include the port number? Commented Oct 2, 2018 at 16:35
  • I should try a new install without using localhost and apache then report back. Commented Oct 2, 2018 at 16:53
  • Well that does not seem to be the case, just tried a fresh install it does same thing. Commented Oct 2, 2018 at 17:02

1 Answer 1

2

Try changing the URLs in the admin panel, so they contain your localhost with the required port: enter image description here

Alternatively, you can define the site url in wp-config.php:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

More information is available with Wordpress documentation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.