I am thinking that as we can use PHP’s built-in server to run Laravel/Symfony and other frameworks locally, Isn’t it possible to run WordPress locally using PHP’s built-in server?
I am trying to run PHP built-in server for WordPress and Simply try to run the server indicating the document root to the WordPress index.php
,
php -S localhost:2000 index.php
But It’s not working and showing some errors like The localhost page isnât working
and similar.
Did anyone try this? There need any more tricks?
Don’t specify index.php on the command line. Run the server like:
php -S localhost:9000
You should be in the root directory of wordpress when running this command. Or Specify the webroot with the -t flag:
php -S localhost:9000 -t <Directory Containing WordPress>