Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Dhakalsandeep's avatar

url(‘/‘) function starts with http://127.0.0.1:6112 on live server

Upon deployment on live server my application named route like route('home') and url('/') route starts with http://127.0.0.1:6112 instead of https://xyzdomain.com. The same problem occured with asset() too but after changing ASSET_URL it is working and i have also changed APP_URL to https://xyzdomain.com.

Can someone please enlighten me on this matter.

0 likes
3 replies
siangboon's avatar

in live web server, the handling of the domain name or ip address usually rely on the apache conf/vhost (or ngix) configuration and .htaccess may also override it... it depend on whether the service is set to listen on a certain host name, ip address or with specific port name... double check the configuration first...

1 like
Dhakalsandeep's avatar

I dont know what the problem was but now its gone and everything is working fine.

edgreenberg's avatar

I have this happening too... My expectation was that the url() function would draw from the APP_URL. Mine has never been set to the IP address and port. It was always set to the name that is in the hosts file on the outside of the reverse proxy and load balancer. The original poster, @dhakalsandeep , stated that he CHANGED the APP_URL. Perhaps he didn't clear the environment cache. When he did later on, things started working. In any case. I'm going to post my question as a new one since this thread is a year old.

Please or to participate in this conversation.