-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$_SERVER['SERVER_PORT'] isn't available in Google App Engine #962
Comments
I have this problem too, i hack que line This Problem was reported in 2010, without Google solution. |
Thanks. I'll add a default value of |
What about get the value from |
Fixes #962, Missing SERVER_PORT on GAE. For branch master.
Fixes #962, Missing SERVER_PORT on GAE. For branch develop.
* upstream/2.x: (33 commits) Updated version number references for upcoming Slim 2.6.3 Clean up the output buffon on error in debug mode Updated version number references for Slim 2 Updated the other code snippets as well Added color to the Readme Update How to Contribute section of README fixed broken license link Update SessionCookie unit tests for new JSON decoding Fix the build indicator. escape html code in exception page update version number in tests folder update version numbers Fix slimphp#1034 (CVE-2015-2171) Correct terminology in README travis: PHP 7.0 nightly added Fixes slimphp#962, Missing SERVER_PORT on GAE. Add HTTP status codes from new RFCs. Update index.php to fix broken "Hello World" link Fix: Method doesn't return anything Fix: Undefined classes ...
@codeguy Reopening an oldie but goodie as I just bumped into this issue. App Engine supports HTTP and HTTPS, so defaulting to 80 doesn't always work. A more reliable way to set the default value is to consult if (!isset($_SERVER['SERVER_PORT'])) {
$_SERVER['SERVER_PORT'] = $_SERVER['HTTPS'] == 'off' ? 80 : 443;
} |
This the message I get:
Notice: Undefined index: SERVER_PORT in /base/data/home/apps/s~myapp/.../vendor/slim/slim/Slim/Environment.php on line 154
My solution was defining (in the beginning of the index.php file):
$_SERVER['SERVER_PORT'] = 80;
The text was updated successfully, but these errors were encountered: