CodeIgniter Forums
is the port number screwing things up? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: is the port number screwing things up? (/showthread.php?tid=80523)



is the port number screwing things up? - richb201 - 11-11-2021

when someone first enters my site with staging.researchstudyonline.com, they immediately go to the wordpress landing page. There is a button on it to enter my php app. It is setup at staging.researchstudyonline.com:8181. So anything with port 8181 goes to my CI3 app.  

I am experiencing some strange situation. I developed my code under docker on my laptop and it did not use port 8181. It was running fine. So I moved it up to AWS and now I am experiencing some strange stuff. 
On my dashboard I have an enter button which has this link
<a href="campaign_management_with_actions" text-align: right;">Enter  </a> <br>
When I press the Enter link it goes to

 
PHP Code:
http://staging.researchstudyonline.com:8181/campaign_management_with_actions 

and this page is not found (404 error). 
BTW, I have set $config['base_url'] = 'http://staging.researchstudyonline.com:8181/'; in config.php
But if I remember correctly the URL created should  have been: 
PHP Code:
http://staging.researchstudyonline.com:8181/index.php/Configure/campaign_management_with_actions 

This is the way it was supposed to work, right? Or am I just having a senior moment?
Is it possible that the :8181 is screwing things up? 

Has anyone successfully used a port number as part of the routing?


RE: is the port number screwing things up? - InsiteFX - 11-12-2021

The port number would not be the same on a live server, if they used one most do not.


RE: is the port number screwing things up? - richb201 - 11-12-2021

"they" are not using a port number, I am using the port number. Actually, the guy I hired to set up my staging server is using ports. My theory is that this route would work
PHP Code:
http://staging.researchstudyonline.com/index.php/Configure/campaign_management_with_actions 
but that this route would not
PHP Code:
http://staging.researchstudyonline.com:8181/campaign_management_with_actions 
I have a debugger running on the system. Is it possible for me to step through the routing logic of the CI3 code to see if the route is actually getting mangled?

I have this is my routes. Is this incorrect?
$route['default_controller'] = 'Configure';

I'd like to be sure that the port is the problem before I go through the trouble of changing it. What module handles the CI3 routing before it gets to my application code?


RE: is the port number screwing things up? - includebeer - 11-13-2021

(11-11-2021, 04:29 PM)richb201 Wrote: Has anyone successfully used a port number as part of the routing?

Yes, I use port 8888 on my computer and it works. I don't think your problem is the port in your config file.
Here is what I have in my .env file:
Code:
app.baseURL = 'http://ci4.test:8888'
app.indexPage = '';



RE: is the port number screwing things up? - richb201 - 11-13-2021

Beer, what is the index Page about? Interesting that you keep the url hidden in a .env file! 

The routing is not working and I have no clue why? Is there any place I could put a breakpoint to debug this?


RE: is the port number screwing things up? - includebeer - 11-13-2021

(11-13-2021, 10:09 AM)richb201 Wrote: Beer, what is the index Page about? Interesting that you keep the url hidden in a .env file! 

It's to remove the index.php from the url. I prefer to set the url and database credentials in the .env file since they are different in all environments (localhost vs. live site).

(11-13-2021, 10:09 AM)richb201 Wrote: The routing is not working and I have no clue why? Is there any place I could put a breakpoint to debug this?

I don't where exactly. You could always start from the index.php and step into everything to see where it's going. Wink


RE: is the port number screwing things up? - richb201 - 11-14-2021

Hey Beer. In index.php I call a function which displays the dashboard. I can see that. But does index.php run every time? Is there a place that only runs one time? If so I would put the function that displays the the dashboard in there.


RE: is the port number screwing things up? - includebeer - 11-15-2021

index.php is the front controller. Everything pass through that.