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

Fenn-CS
  • 863
  • 1
  • 13
  • 30
  • 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 – RiggsFolly Oct 02 '18 at 16:31
  • 1
    There should be a setting in your WP admin to change the base URL to include the port number? – miken32 Oct 02 '18 at 16:35
  • I should try a new install without using localhost and apache then report back. – Fenn-CS Oct 02 '18 at 16:53
  • Well that does not seem to be the case, just tried a fresh install it does same thing. – Fenn-CS Oct 02 '18 at 17:02

1 Answers1

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.

mkveksas
  • 171
  • 8