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

saadaan's avatar

Accessing another port on the laravel server

Hi,

So I have Laravel installed on this server, at which I am given the webserver access in the form of port number (i.e. http://1.2.3.4:8080). I need to invoke a script on the same server (outside of Laravel) residing on port 13001. But when I use curl or guzzle with localhost URL, it gives me '404 not found' error. I also tried 127.0.0.1 and IP address itself, but unsuccessful.

Need some help on this.

Thanks.

0 likes
5 replies
Sinnbeck's avatar

What is laravel server in this case? A hosted server at digital ocean? Or php artisan serve? Can you access that second script in the browser? How are you running the server for the second site?

saadaan's avatar

@Sinnbeck

  • Yes, its a hosted server in a datacenter, not digital ocean.
  • I can access the script in browser and it works.
  • Its an SMS gateway (kannel to be precise) and it's URL access has cgi-bin in it (sorry i forgot the terminology name).
Snapey's avatar

try using the same hostname as your laravel app but with the specified port?

saadaan's avatar

@Snapey I can try that. TO be precise, where exactly to pick up hostname from inside laravel config?

saadaan's avatar
saadaan
OP
Best Answer
Level 2

Hi,

I seem to have fixed the issue. There was an error in my call, which is now fixed and things are working. Thanks!

Please or to participate in this conversation.