google-compute-engine"/>
  • 14
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

I couldn't transfer a file to my VM instance

I was following along with this tutorial: https://cloud.google.com/community/tutorials/setting-up-lamp

and I wanted to upload a php file to my instance to run, using the following command:

gcloud compute scp [LOCAL_FILE_PATH] lamp-tutorial:/var/www/html

but I got the following:

enter image description here

What went wrong? And how could I transfer files to my instance?

You have to run these commands on your local computer that contains the files you want to send to the virtual machine, not the Cloud Shell, or the remote virtual machine itself.

  • 0
Reply Report

There are many ways to transfer files to GCP vm instances, the one that I like is using native function to upload files, to use it, in your GCP console go to your instance, click SSH button and in the top right corner of the SSH window you will see a gear, click it and there is an option called “upload file,” that will open a menu where you can browse your local drive(s) and choose the file which you want to upload, click upload button and that’s it. Here you can consult Google documentation about this process.

However if you’re interested in transfer files using gcloud commands from your workstation, it is necessary to install Cloud SDK and configure it to interact with your project and instances, in order to perform that task you can visit this page which contains all the information that you need to start, in this menu you can find the official GCP software for your OS and a full starter guide.

Finally, the command that you’re running must be execute from your local machine using SDK tools, or in cloud shell, to open cloud shell, look in the top right corner of your GCP console the icon with this symbols “>_” click it, and you will see the cloud shell, nevertheless before transfer any file to your instance using cloud shell it is necessary to upload the file to your project, this process is similar to the first that I described, this document can help to clarify the process.

Hope this information will be useful for you.

  • 0
Reply Report

Warm tip !!!

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

Trending Tags