google-compute-engine"/>
1Answer
  • 7
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

google cloud compute engine / vm

I have created an instance on Google Compute Engine and setup a web application in it. But the issue is that the web app picks internal IP address instead of the external which causes the app to malfunction.

Is there a solution to this issue that does require rewriting the code? It'd be just easier if the internal IP is just disabled.

      • 1
    • no i haven't. i will try to restart the instance and hopefully it works. i think it-s defintly beacayse the php function which is supposed to grab the external IP confuses it with the internal IP. i-ll try to restart the IP and see if it works Thank you again.

You can verify the firewall and assure you to have the port open to the internet (0.0.0.0/0) if you want it public. Its explained on the documentation but the big picture is:

  1. You create a firewall rule and define a network tag.
  2. Appply the network tag to your GCE instance by editing it.
  3. Configure your App to use the external IP instead 127.0.0.1 in config file.
  4. I also recomment to use a static external IP.

If you plan to don't use your internal IP at all, you can simply delete it but keep in mind that internal IP can be usefull as backend communication between your instances (external database or any other VMs).

  • 1
Reply Report
      • 1
    • Mr. Bruno thank you so much for answering taking the time to answer my question. i'd prefer to not use internal IP at all. and i do wish to delete it if it's possible at all. i believe this article is about removing the "static IP" for the internal IP. but the latter will be retained. i don't think it is an issue with the firewall as the app generally function except for some situations where i click a link it grabs the internal instead of external.
      • 1
    • ``` Your instance continues to use the static IP address until the instance is deleted or restarted. After that occurs, the IP address is returned to the subnet's default pool of available internal IP addresses. ``` Have you tried to restart your VM instance ?

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags