Welcome Guest, Not a member yet? Register   Sign In
adding SERVER_PORT to base_url setting function
#1

(This post was last modified: 05-18-2016, 05:51 PM by Sangwon Kim.)

My English is not good. Sorry about that.

What do you guys think about adding SERVER_PORT to base_url setting function in __construct() of core/Config.php

If I don't set a BASE_URL at the configuration, It doesn't works.
Reply
#2

(This post was last modified: 05-21-2016, 01:48 PM by chrisi1698.)

hello everyone!

(05-17-2016, 12:13 AM)Sangwon Kim Wrote: My English is not good. Sorry about that.

What do you guys think about adding SERVER_PORT to base_url setting function in __construct() of core/Config.php

If I don't set a BASE_URL at the configuration, It doesn't works.

same issue here, I quickly fixed it myself by adding

PHP Code:
    if(isset($_SERVER['SERVER_PORT'])) {
        
$port $_SERVER['SERVER_PORT'];
        if(
is_https()) {
            if(
$port != 443$server_addr .= ':'.$port;
        }
        else {
            if(
$port != 80$server_addr .= ':'.$port;
        }
    } 

for CodeIgniter 3.0.6 in system/core/Config.php:101 (in __construct(), before setting $base_url)

maybe it helps, works for me in development on nginx+hhvm/fcgi and lighttpd+php-fcgi

BR, chris
Reply
#3

I am, yet again, stunned by the efforts people put into not filling a single configuration setting.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB