PHP built in server and .htaccess mod rewrites

Here’s the router that I use for the builtin php webserver that serves assets from the filesystem if they exist and otherwise performs a rewrite to an index.php file. Run using: php -S localhost:8080 router.php router.php: <?php chdir(__DIR__); $filePath = realpath(ltrim($_SERVER[“REQUEST_URI”], “https://stackoverflow.com/”)); if ($filePath && is_dir($filePath)){ // attempt to find an index file foreach ([‘index.php’, … Read more

Set port for php artisan.php serve

Laravel 5.8 to 8.0 and above Simply pass it as a paramter: php artisan serve –port=8080 You may also bind to a specific host by: php artisan serve –host=0.0.0.0 –port=8080 Or (for Laravel 6+) you can provide defaults by setting SERVER_PORT and SERVER_HOST in your .env file. You might need to do php artisan cache: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)