by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 years ago )

Apache removed the Authorization Header, and there is no solution in $_SERVER.

You can try to add the following content in .htaccess, and it will be normal.
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
In this way, you can use pure PHP to get the token in the header of the request.
<?php
echo $_SERVER['HTTP_AUTHORIZATION'];

 

Tags: php

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


php

How to install PHP 7.1.7 in the old version of CentOS 5.11?

How to install PHP 7.1.7 on the old version of CentOS 5.11? An insfinit error occurred when compiling by myself. This article introduces my method.

docker,php,cli

MacOS's php is not powerful, use docker to execute laravel installer

It's very simple, just add an "alias" alias laravel='docker run --rm -v ${PWD}:/var/www/html -v ~/.dlaravel/cache:/home/dlaravel/.composer /cache -ti deviny/fpm:8.1.10 /home/dlaravel/.composer/vendor/bin/laravel'

fastapi,phpenv,docker

How do I create a fastapi runtime environment with phpenv

phpenv php laravel runs HAProxy, and automatically applies for and updates free certification, now let him run Python's fastapi. There is no limit to phpenv, the limit is your idea.😆