Set $_SERVER[‘REQUEST_URI’] when running PHP script from terminal

Posted on June 7, 2018 at 11:52 pm

Simulate $_SERVER[‘REQUEST_URI’] on a PHP script executed from terminal:

export REQUEST_URI="/admin/" && php -f index.php

That would simulate http://www.yourwebsite/admin/ as REQUEST_URI.

Updated on June 8, 2018 at 12:06 am

Receive updates via email

Other Posts

Updated Posts