For clarity, this is not a PHP issue but a WordPress one. The first thing you need to try is to flush your rewrite rules and double check the permalink structure you are attempting to use, as /post/123/ is not by any means a default setup; go to Settings >> Permalinks, and choose the structure you would like to use (most commonly 'Month and name', aka '/%year%/%monthnum%/%postname%/') then click Save Changes.
After you do that, go to Posts, and hover over a post title until the action links appear. Click 'View' and your permalink structure should be working. If it's still not at this point, I would check to see if your .htaccess file was created properly (WordPress will usually notify you if it is not, but check anyways), and failing that you should check into whether or not you even have .htaccess capabilities on your host.